Posts

Showing posts from April, 2014

asp.net - Unsupported Oracle data type USERDEFINED encountered -

sqldatasource chargesds = (sqldatasource)lv2item.findcontrol("charges_gv_datasource"); string sql = "with relevant_ids (select ir.result_id relevant_result_id inspection_result_tbl ir ir.inspection_job_id= '" + incidentid.text + "') select ir.charge_id, collect(ir.result_id) result_ids, ch.charge_progress, ch.claim_verification, ch.hours_allowed, ch.sap_notification, ch.total_checked, ch.charge inspection_result_tbl ir left join relevant_ids on ir.result_id=relevant_ids.relevant_result_id left join charges_tbl ch on ir.charge_id=ch.charge_id ir.charge_id not null group ir.charge_id, ch.charge_progress, ch.claim_verification, ch.hours_allowed, ch.sap_notification, ch.total_checked, ch.charge"; chargesds.selectcommand = sql; i have data source im giving select command shown above giving me error: unsupported oracle data type userdefined encountered. with stack trace: [notsupportedexception: unsupported oracle data type

Is it possible to define two methods in a Rails model that require different initialization? -

hi i'm attempting create model in rails can perform 2 calculations. code: class calculator def initialize(nair, cppy, interest_rate, payment, periods) @nair = nair.to_f / 100 @cppy = cppy.to_f @interest_rate = interest_rate @payment = payment @periods = periods end def effective refinance::annuities.effective_interest_rate(@nair, @cppy) end def principal refinance::annuities.principal(@interest_rate, @payment, @periods) end end i have 2 forms reside in different views take input user including 'nair' , 'cppy' on 1 , 'interest_rate', 'payment' , 'periods' on other. the problem i've run use model 5 arguments need available. do need have separate models each calculation? i'm complete beginning sorry if there obvious answer. thanks! there's dozen different ways solve this, 1 possible approach use default arguments in initialize method. class calculat

How to call LinkedServer tables in sqlserver from SSAS -

i have created linked server in mssql. next try create cube in ssas, when create data source view in ssas mssql not showing linked server name. is possible access linked server tables ssas? why need linked server? tables cube in different databases on different servers? if are, have tried creating view in primary server uses linked servers, have these views in ssas cube dsv? also, data warehousing, faster process if gather data want in cube single database first. if have large databases may essential.

silverlight - How to create a transparent layer in windows phone? -

Image
is possible create transparent layer in windows phone? need is? in first screen there 2 buttons , in second screen, transparent layer should formed when button pressed , listpicker on transparent screen. when value selected in listpicker, value should binded button's content name in background screen. , transparent screen , listpicker should disappeared.any suggestions? create canvas, choose fill color, size etc, , set opacity right value give effect or create semi-translucent .png image , set source of image in project. for smooth transition use storyboard fade in image or canvas.

opengl - is switching glPixelStorei a slow operation? -

i have lots of different formats rbg, rbga , alpha , loading textures requires changing gl_unpack_alignment between 1 , 4. worth caching? having variable "alignment" , calling glpixelstorei if state differs vs calling glpixelstorei time. same idea texture switching. well, let's consider this. every time change gl_pack_alignment , call gltexsubimage . function will, at best , provoke dma operation client memory opengl's internal texture memory. if you're not using pbos, means function have copy client memory internal storage dma. , if using pbos, you're going have copy operation memory. do think changing state of pack alignment mean anything performance-wise next operations you're doing right after? think computing bitmap of glyph or uploading bitmap data texture faster changing piece of state? don't worry it.

android emulator - google maps v2 does not load after publishing in google play -

i developed app based on google maps api v2, before publishing checked app on device , emulator worked fine, after publishing , (when downloading through google play) map not load ,i see white space not map.. i preety confused here. please guide me solve problem. thanks it not normal behaviour @ all. "maps api keys linked specific certificate/package pairs, rather users or applications. " https://developers.google.com/maps/documentation/android/start#the_google_maps_api_key you need api key signing certificate , put in manifest.

entity framework - Code First - Retrieve and Update Record in a Transaction without Deadlocks -

i have ef code first context represents queue of jobs processing application can retrieve , run. these processing applications can running on different machines pointing @ same database. the context provides method returns queueitem if there work do, or null, called collectqueueitem . to ensure no 2 applications can pick same job, collection takes place in transaction isolation level of repeatable read . means if there 2 attempts pick same job @ same time, 1 chosen deadlock victim , rolled back. can handle catching dbupdateexception , return null . here code collectqueueitem method: public queueitem collectqueueitem() { using (var transaction = new transactionscope(transactionscopeoption.required, new transactionoptions { isolationlevel = isolationlevel.repeatableread })) { try { var queueitem = this.queueitems.firstordefault(qi => !qi.islocked); if (queueitem != null) { queueitem.datecolle

python - Differentiate between local max as part of peak and absolute max of peak -

Image
i have taken amplitude data 10-second clip of mp3. performed fast-fourier-transform on data clip in frequency domain (shown in first figure). determine frequencies peaks located at. i started smoothing data, can seen below in blue , red plots. created threshold peaks must on in order considered. horizontal blue line on third plot below. can seen, peak detection code worked, extent. the problem having evident in final plot shown below. code finding maxima local maxima part of overall peak. need way filter out these local maxima each peak, getting single marker. i.e. peak shown below want marker @ absolute peak, not @ each minor peak along way. my peak detection code shown below: for i, item in enumerate(xavg): #xavg contains smoothed data points if xavg[i] > threshold: #points must above threshold #if not first or last point (so index isn't out of range) if (i > 0) , (i < (len(xavg)-1)): #greater points on eithe

ios - Facebook SDK 3.6 Open Graph Error Message -

Image
im trying use new share dialog , works fine when facebook app not installed , im sharing own viewcontroller: if (!call) { // fallback customized share ui myshareviewcontroller *viewcontroller = [[myshareviewcontroller alloc] initwithitem:object objecttype:@"objecttype" actiontype:@"namespace:action"]; [_delegate showfallbacksharedialog:viewcontroller]; } so code gets called when facebook app isnt installed. when installed device opens facebook app , here user can type message included in open graph action but after few second devices switches app , error shows up: error: error domain=com.facebook.facebook.platform code=102 "the operation couldn’t completed. (com.facebook.facebook.platform error 102.)" userinfo=xxxx {error_code=102, action_id=xxx-xxx-xxx-x

php - Password submitted in form does not match password at the database -

i wrote login form, , after hitting submit button, want check if user exists @ database. if(isset($_post['submitbtn'])){ if($_post['senderlogin'] == 'customer'){ $checkifexists = new customersdao(); $stam = $checkifexists->isexist($_post["name"], $_post["password"]); var_dump($stam); } } and checking that: public function isexist($name, $password) { $this->connect(); if($this->con){ $sql = "select * customers name=? , password=?"; $stmt = $this->db->prepare($sql); $password = md5($password); $stmt->bindparam(1, $name); $stmt->bindparam(2, $password); $stmt->execute(); $fetched = $stmt->fetchcolumn(); $this->disconnect(); if($fetched > 0) { return true; } else { return false;} } } the passwords @ database encrypted md5. i tried type user exi

architecture - Proper way to manage shaders in OpenGL -

i'm writing code in c++ deal usual 3d stuff - models, materials, lights, etc. however, i'm finding work, needs know shader. eg, set uniform variables material, need know handles shader; load mesh memory, need know handles different in locations. i've ended having models, materials, etc. each have handle shader can things gluniform1f(shader->getkdlocation(),kd) , kind of hot potato seems bad design me. i've seen tutorials uniforms , ins , outs hardcoded in shader (eg layout = 0) , bound gluniform1f(0,kd) ,. however, means rest of code function specially laid out shaders , therefore seems suboptimal solution. also, don't think can subroutines, makes inconsistent option. it seems choice between getting shader reference , in cases being unable instantiate without 1 (eg meshes) or hardcoding numbers in more places , having deal problems follow hardcoding. i should able have these models, lights, etc. live/operate independently , "work" when set s

ios - Social Sharing on various network by single click -

i want share text or images on various social networks (e.g. google+, facebook, twitter, linkedin, youtube) single click. i want first login social networks. user can post text , images on selected option. reference want this . please give me suggestion or demo perform task. what first suggest take @ various social network's apis in order see what's possible on each 1 , how implement various sign-in protocols. next should present in sort of nice way user login prompt each network, allows freedom choose networks want associated app. suggest research how each can post each network. require prompt user, , can post directly without user's consent. identify which , when allow user post something, allow them select ones want post to, , present prompt networks last.

xaml - WPF disable ListBox autosizing in uniform grid -

Image
i have following structure: <uniformgrid horizontalalignment="stretch" grid.row="0" verticalalignment="top" columns="6" dockpanel.dock="right" > <stackpanel horizontalalignment="stretch"> <dockpanel background="#ff393939" > <label content="{lex:loc site}" foreground="#ffe0e0e0"/> </dockpanel> <listbox height="300" itemssource="{binding sites.view}" displaymemberpath="name.actualtranslation"> </listbox> </stackpanel>... these stackpanels in uniformgrid should spreaded on whole mainwindow (or view)... still if there item in listbox has longer string needs more place standard width autofits string , have scroll vertically. i dont want listview gain width if content has not enough place. have scrollviewer in mainwindow in view placed... what can uniform grid stays same wi

c - Why do I get "Header file missing" (make error)? -

Image
i'm trying install geocoder website i'm building. i'm using geocoder because query limit google maps api falls short of needs. installed gems required , have sqlite3. when i'm trying install geocoder gem (geocoder::us) error while running make file. i'm getting error cannot figure out. mentions error (in title) talks of non-existent file ( sqlite3ext.h ). here error: i know vague i've been working 10+ hours trying install , have found little online. advice on direction go appreciated. this project's readme : to build geocoder::us, need gcc/g++, make, bash or equivalent, standard *nix ‘unzip’ utility, , sqlite 3 executable , development files installed on system. it seems lack sqlite3 development headers. this relevant: note: if not have /usr/include/sqlite3ext.h installed, sqlite3 binaries not configured support dynamic extension loading. if not, must compile , install sqlite source, or rebuild system packages

orchardcms - Orchard custom field not getting posted correctly -

i have created custom field in orchard meant contain 1 field (guid). whenever added content type, show new guid in "editor" template. works fine, except when submit form contains content type, form gets posted different guid. on looking closely, found driver of field editor (post) not updates viewmodel field. any suggestion or tips debug ? here lines of code protected override driverresult display( contentpart part, fields.uniqueidfield field, string displaytype, dynamic shapehelper) { return contentshape("fields_string", // key in shape table getdifferentiator(field, part), () => { var settings = field.partfielddefinition.settings.getmodel<uniqueidfieldsettings>(); var value = field.id; var viewmodel = new uniqueidfieldviewmodel { id = value

php - Account creation review step - post form validation -

i have question has been bugging me quite while now. working on project has form tied payment gateway. form validated , once valid after user clicks 'sign up', credit card number automatically charged (without review). i trying add intermediate step pretty summary of amount going charged , information going used account creation. debating between 2 approaches: 1) post data posted additional page before account created (and credit card charged), page if information correct (in users eyes), users click sign , account created - require re-posting variables or creating session variables... 2) use javascript hide form 'on submit', , show hidden, review container, using javascript, set html fields of hidden review screen before showing it, here when user confirms information correct, account created / credit card charged, , did without session / reposting of variables. however, noticed lot of websites tend use approach number 1 above. wondering why this, , approac

java - How is the filter implementation in JMS ActiveMQ in Mule? -

how specific "jmsmessageid" activemq queue? mean, imagine client sends request queue, gets processed , waiting response (from response queue, lets say). in other words, client listening response queue. wants response returned. as far i've read there possibility of getting using correlationid or messageid. so imagine there way set , id request , response filtered it. right? haven't found mule documentation far. basics. how can achieved? thanks. it seems referring request-reply routing message processor of mule allows block flow execution until response received on asynchronous channel, mule taking care of matching requests , responses via correlation id. this work fine jms request queue , jms response queue. you same behaviour using request-response jms endpoint without use of temporary response queues.

thread safety - C# Thead-Safe collection in Object -

this example code illustrate question. assume have following class: enter code here using system; using system.collections.generic; using system.linq; using system.text; using system.collections.concurrent; namespace boxesa4 { class box { public double length { get; set; } public double width { get; set; } public double height { get; set; } concurrentdictionary<int, string> boxitems = new concurrentdictionary<int, string>(); public box(double length,double width,double height) { this.length=length; this.width = width; this.height = height; } public double volume() { return this.length * this.width * this.height; } public void add(int index,string item) { boxitems.tryadd(index, item); } } } main: static void main(string[] args) { box createbox = new box(10,10,5,5); createbox.add(0,"hammer"); createbox.add(1,"saw"

mysql - Get all rows within a specifiy range/radius (Document Term Matrix) -

i store document-term matrix in mysql , want results queries these: example: rows token_id '1' , token_id '2'(but maybe more 2) within range of 10 words. my table: dt_matrix_token_id int(11) pk auto_increment, token_id int(11), storage_data_id int(11), position int(11) so token_id describes token , position describes on position in original text token was. selecting rows token_id not problem, problem on how describe inside query both words must within specific "radius/range". select * dt_matrix_token token_id in(1,2) , ??? ??? stuck, because how can tell shall query against found values? because when result contains row position = 12 other valid rows should have position >= 2 & position =< 22 btw: similiar geo location query within radius? edit: heres actual progress sample data: http://sqlfiddle.com/#!2/52f48/2 the query works fine, not complete yet, if 2x token 1 matches in document, "valid" result, , of course

python - tab complete dictionary keys in ipython -

i wondering if knows how enable or implement tab completion dictionary keys in ipython? seems wouldn't different functionality exists, tab completion of object attributes. if i'm wrong, i'd understand why ipython supports dict key completion string keys since version 3.0.0 (despite not appearing in release notes), this patch . supports column name completion numpy struct arrays , pandas dataframe columns, , other types redefine __getitem__ through defining _ipython_key_completions_ .

php - in_array() expects parameter 2 to be array, boolean given -

problem in_array() on php code. have following array: array ( [0] => 11 [1] => 13 [2] => 14 [3] => 15 [4] => 16 [5] => 17 [6] => 18 [7] => 19 [8] => 20 [9] => 21 [10] => 22 [11] => 23 [12] => 24 [13] => 25 [14] => 26 [15] => 27 [16] => 28 [17] => 29 ) and following function removes element array (since unset not keep indexes): function removefromarray($value, $array) { // if value in array if (in_array($value, $array)) { // key of value $key = array_search($value, $array); // remove element unset($array[$key]); // fix key indexes $array = array_values($array); return $array; } return false; } unfortunately i'm getting error: "in_array() expects parameter 2 array, boolean given" when in_array($value, $array), if condition. happens whatever element of array. i'v

c# - How to fix message boxes appearing behind splash screen? -

my winforms app's main window slow load (up 20 seconds, depending on arguments), needs splash screen. the main window constructor slow because exercises thousands of lines of code (some of beyond influence). code pops message boxes. i've tried 2 splash screen designs, each have problems. better ideas? splash screen backgroundworker static void main(string[] args) { var splash = !args.contains("--no-splash"); if (splash) { var bw = new backgroundworker(); bw.dowork += (sender, eventargs) => showsplash(); bw.runworkerasync(); } var app = new formmain(args); // slow. opens blocking message boxes. application.run(app); } private static void showsplash() { using (var splash = new formsplash()) { splash.show(); splash.refresh(); thread.sleep(timespan.fromseconds(2)); } } problems: splash screen expires before main window open (user thinks app has crashed) main window m

java - Spring RmiExporter service fails after successful startup -

i'm experiencing situation rmi service configured using spring's rmiserviceexporter starting fine, , usable while - after unknown amount of time, service unavailable though java process spring context still running. at moment work around reboot java process, hardly acceptable in production environment. cannot figure out, or begin guess, why might happening, or might going wrong. no s/o or google search has been useful, because find examples of rmiserviceexporter failing start @ all, not starting ok , failing later on. clue @ useful. output of lsof | head -1;lsof | grep 1197 , before service fails: command pid user fd type device size/off node name java 6882 ubuntu 176u ipv6 54677985 0t0 tcp *:1197 (listen) service-side spring config: <bean class="org.springframework.remoting.rmi.rmiserviceexporter"> <property name="servicename" value="myrmiservice" /

c++ - Get member data from a thread -

i reading .csv file using multiple threads. each thread reads part of .csv file, eg. thread1 reads line:214 line:359 . csvreader reader1("c:\\file.csv", 214, 359); during reading process, data fields stored in vector instance. data[i].push_back(data_field); in main function, codes below: csvreader reader1("c:\\file.csv", 214, 359); csvreader reader2("c:\\file.csv", 360, 517); thread t1(&csvreader::read_range, reader1); thread t2(&csvreader::read_range, reader2); t1.join(); t2.join(); vector<vector<string>> temp_data = reader1.get_data(); // here have problem ideally, reader1.get_data() should return data between line:214 , line:359 . when temp_data , found not changed @ all. may know wrong? , how can fix it? when create threads pass copies of reader1 , reader2 , copies modified not original objects. means data added copies, , original objects unchanged. pass them reference use std::ref(reader1) , st

android - OnRestoreInstanceState() not applied on View IDs that have been set programmatically -

i have viewgroup programmatically instantiates , assigns id viewpager. on rotation, "up" button , changing screen orientation recreate views -- doesn't remember last page index of viewpager. i've verified onsaveinstancestate() , onrestoreinstancestate() both being called, , both of them contain correct page index information. but, viewpager gets reset page index 0 regardless. notice message in console no package identifier when getting name resource number [id programmatically defined] as experiment, defined viewpager (along id) in xml. correctly set viewpager last page index. so, suspect android framework can't restore last state correctly because id doesn't persist when viewgroup viewpager gets destroyed. how can work? i'd contain state relating things within viewgroup (eg avoid keeping track of viewpager position in fragment). but, doesn't seem can work unless can make id persist (if that's root cause). edit: there r

c++ - boost::multi_index error "template argument 'x' is invalid" -

so made kind of database boost_multi_index this: #include <boost\multi_index_container.hpp> #include <boost\multi_index\ordered_index.hpp> #include <boost\multi_index\member.hpp> using namespace boost::multi_index; using namespace std; struct list_entry{ int id; string name; string* data; }; typedef multi_index_container<list_entry, indexed_by< ordered_unique< tag<int>, member<list_entry, int, &list_entry::id>>, // unique id ordered_unique< tag<string>, member<list_entry, string, &list_entry::name>>, // unique name ordered_non_unique< tag<string*>, member<list_entry, string*, &list_entry::data>> // data associated id/name > >table; class database { private: table music, names; typedef table::index<int>::type list_id; typedef table::index<string>::type list_string; //s

java - The type of the expression must be an array type but it resolved to long -

i have problem, sought little can't figure why it's append ... if me. public class menu extends activity { private sqlitedatabase db; private gridview grid; private button add; private button info; private button deco; private string lab[]; private string id[]; protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.menu); grid = (gridview) findviewbyid(r.id.grid); add = (button) findviewbyid(r.id.add_account); info = (button) findviewbyid(r.id.info); deco = (button) findviewbyid(r.id.deconnexion); add.setonclicklistener(add_listener); info.setonclicklistener(info_listener); deco.setonclicklistener(deco_listener); try { db = openorcreatedatabase("tmp_tttt_tla", mode_private, null); } catch(sqliteexception e) { toast.maketext(menu.this, "impossible d'avoir accès à la base de donnéee.", toast.length_long).show();

php - Getting the values from array -

i new codeigniter. in model, have following code: public function get_all_subjects() { return $this->db->get('subjects'); } in controller, have: public function index() { $this->load->model('subjects'); $data['content'] = $this->subjects->get_all_subjects(); $this->load->view('home', $data); } i trying values in view: foreach($content $val) { echo $val['subject']; //i getting error, message: undefined index: subject } the fields in subjects table subject_id , subject . i getting error message: undefined index: subject public function get_all_subjects() { return $this->db->get('subjects')->result_array(); } you not returning result query. have run query.

javascript - MySQL, Selecting the index based on MIN timestamp -

i trying index of row maximum timestamp. however, can't seem index. here's code: client.query('select inde, min( stamp ) archive', function(err, result){ console.log(result); }); 'stamp' timestamp column. above code return 1 index , timestamp. but, when switch min max, printed timestamp change max index remains same (it returns minimum index). you're getting asked for. inde fields table, along overall global mininum records in table. to record(s) associated minimum value, need more complicated query: select * archive stamp = (select min(stamp) archive)

c# - Identification of active network card and get Default Gateway -

Image
this question has answer here: get default gateway 7 answers how identification of active network card , default gateway? the following code gives first default gateway: networkinterface card = networkinterface.getallnetworkinterfaces().firstordefault(); if (card == null) return null; gatewayipaddressinformation address = card.getipproperties().gatewayaddresses.firstordefault(); if (address == null) return null; return address.address;

java - How can I trim whitespace by Velocity -

i have method called render_something can creates lot of whitespace, example: <a href="#">#render_something('xxx')</a> the result can be: <a href="#"> generate redner_something </a> which want this: <a href="#">something generate redner_something</a> does velocity has this? #trim(#render_something('xxx')) i read article on velocity whitespace gobbling suggests few work-arounds including velocity whitespace truncated line comment . this suggests commenting out line breaks putting comments @ end of each line. suggests not indenting code in macros prevent superfluous (one of favourite words) spaces occurring. tbh it's not great solution may suit needs. put ## @ end of each line in macro , make things little bit nicer... sort of

Javascript, execute scripts code in order inserted into dom tree -

not duplicate have yet found satisfying answer on other threads: load , execute javascript code synchronously loading html , script order execution load , execute javascript code synchronously looking native javascript answers, no jquery, no requirejs, , forth please :) summary of entire question: i want asynchronously load scripts have ordered execution i trying enforce code in inserted script elements execute in same order added dom tree. that is, if insert 2 script tags , first , second, code in first must fire before second, no matter finishes loading first. i have tried async attribute , defer attribute when inserting head doesn't seem obey. i have tried element.setattribute("defer", "") , element.setattribute("async", false) , other combinations. the issue experiencing has when including external script, test have performed there latency. the second script, local 1 is fired before first one, though inserted a

visual studio 2010 - Is it possible to set multiple environment variables in one CMD line statement? -

i have powershell script set execute after msbuild finished. uses environment variables set in postbuild section of build process (build directories , like.) looks this: set mage="c:\program files (x86)\microsoft sdks\windows\v7.0a\bin\netfx 4.0 tools\mage.exe" set appfile=$(targetdir)$(targetname).application set manifest=$(targetpath).manifest set cert=$(projectdir)$(targetname).pfx set projectname=$(targetname) set configuration=$(configurationname) set targetdir=$(targetdir) set teambuild=$false powershell -file "$(projectdir)postbuild.ps1" with each set operating on separate line, still within same cmd instance. is there way can set multiple variables @ once using 1 line instead of 7? yes, can pipe commands together: set a="hi" | set b="bye"

java - Get Network Computer Names -

i'm looking better way computer names in lan network java. have tried: byte[] ip = {(byte)192,(byte)168,(byte)178,(byte)1}; for(int i=1;i<255;i++) { ip[3] = (byte)i; try { inetaddress addr = inetaddress.getbyaddress(ip); string s = addr.gethostname(); system.out.println(s); } catch(unknownhostexception e) { system.out.println(e.getmessage()); } } ... it's slow. there other way? i on windows. any ideas appreciated. you can increase speed using multiple threads. have each thread execute 1 or more of iterations of 'try' block.

ruby on rails - Wizard nested form using wicked -

i have nested form in wizard. how can perform update action both table gets updated @ same time. form is: <%= form_for(@web, url: wizard_path, :method => :put, html: {:class=>"form-horizontal, left"}) |f| %> <%= fields_for resource.role |rf| %> <%= rf.text_field :fname, :class=>"span5", type: "text", placeholder: "first name", required: "" %> </div> </div> <%= rf.text_field :lname, :class=>"span5", type: "text", placeholder: "last name", required: "" %> <% end %> <% end %> where have resource.role = "user". my models web , user. i tried doing web table gets updated: class userstepscontroller < applicationcontroller include wicked::wizard steps :personal, :organization def show @web = current_web render_wizard end def update @web = current_web @web.attributes = params[:web]

xml - PHP array_unique not behaving as expected -

i have little php script running. puts content of xml file , assigns variable. create array containing xml tags , values want use, using parse array function lib_parse.php: function parse_array($string, $beg_tag, $close_tag) { preg_match_all("($beg_tag(.*)$close_tag)siu", $string, $matching_data); //preg_match_all("($beg_tag(.*)($beg_tag(.*)$close_tag)+(.*)$close_tag)siu", $string, $matching_data); return $matching_data[0]; } this works well. but remove duplicates huge array. have done through excel , know should give me 3945 xml tags , values. when run array through array_unique, returns me array 3945 lines 400 of them contain xml tags , values want, others blank lines. $value = file_get_contents("myxmlfile.xml"); $array = parse_array($value, "<marker", "/>"); $clean_array = array_unique($array); i use loop put values of array xml file. any ideas? sorry length of this.

javascript - JQuery is not picking up echo from php -

i'm echoing message ('ok') php script jquery ajax call. i'm echoing out correct message, , showing in console when log it, appropriate jquery function not firing - according code should password has been changed successfully" message, "there problem" message - can suggest reason why? here code first php: if(isset($_post['oldpass'])){ $oldpass = mysql_real_escape_string($_post['oldpass']); $newpass = mysql_real_escape_string($_post['newpass']); $sql = "select password, salt users email='$log_email' , id='$log_id' limit 1"; $query = mysqli_query($db_conx, $sql); $numrows = mysqli_num_rows($query); if($numrows > 0){ while($row = mysqli_fetch_array($query, mysqli_assoc)){ $current_salt = $row["salt"]; $db_pass = $row["password"]; } $old_pass_hash = crypt($oldpass, $current_salt); if ($old_pass_hash

Makefile Compiling Issue for Mixed C++ and Fortran Program -

this makefile : program = mf2005-gpu.f # define fortran compile flags f90flags= -g -fopenmp f90= gfortran # define c compile flags # -d_uf defines unix naming conventions mixed language compilation. cflags= -d_uf -o3 cc= gcc cppflags= -dcpp_variable cxx= g++ # define gmg objects # gmg = r_vector.o\ solvers.o\ ccfd.o\ mf2kgmg.o\ # define libraries syslibs= -lc usrlib = cuda_lib64=/cm/shared/apps/cuda40/toolkit/4.0.17/lib64/ lflags = -l$(cuda_lib64) -lcuda -lcudart -lcusparse -lcublas -lpthread -lm -lcufft -lcurand -lnpp -lgomp # define object files make modflow objects = \ dblas.o\ gwf2bas7.o \ de47.o \ dlapak.o\ pcg7.o \ sip7.o \ gmg7.o \ mhc7.o \ gwf2bcf7.o \ gwf2lpf7.o \ gwf2huf7.o \ gwf2rch7.o \ gwfuzfmodule.o \ gwfsfrmodule.o \ gwf2lak7.o \ gwf2sfr7.o \ gwf2uzf1.o \ gwf2gag7.o \ gwf2chd7.o \

Facebook could not post to wall facebook error 1367001 -

this self answer result of agonizing on deprecated facebook sharer url based api, kept refusing post url had setup through sharer url format. resultant response following no matter privacy setting set: { "__ar":1, "error":1367001, "errorsummary":"could not post wall", "errordescription":"the message not posted wall.", "payload":null, "bootloadable":{}, "ixdata":[] } my mess of code. (yes breaks every convention known web development , yes inherited code.) <?php $url = urlencode(domain::getdomain()."/".$details['urlname']); $title=urlencode($details['name']); $summary=$details['name']; $image=urlencode(constant('base_images').'/'.$details['gallery']['listing'][0]['thumb']['src']); ?> <a onclick="window.open('http://www.facebook.com/sharer.ph

air - Unable to publish directly to Android device, stuck on "Uninstalling..." within IntelliJ IDE -

i publishing adobe air app android device using intellij getting stuck. able build apk, move device, , install without problems. trouble comes when attempt publish app directly device. first request install air runtime though installed, couple quick dialogs come , go until see "uninstalling mobiletestair" (mobiletestair name of app). dialog doesn't go away, , intellij not successful in uninstalling app. obviously there problem communicating device, unsure how correct or party involved blame. i'm using: intellij 12 adobe air sdk, packaged within apache flex 4.91 (air version 3.4) nexus 7 2013 version, unrooted android 4.3 windows 8 google usb drivers installed current android sdk installed update: have attempted apply fix work 4.2.2 (what phone runs) , getting following when test connection device command adb devices : adb server out of date. killing... adb server disk ack * failed start daemon * error: (no error shown) this may root cause.

javascript - Array.filter breaking safari print -

i have print function works in except safari. when print button clicked, error thrown: typeerror: 'undefined' not function (evaluating 'array.filter( document.getelementsbyclassname('printarea_1'), function(elem){ $(".printing_list").printelement( elem ); })') the thing breaking safari code array.filter, witch works in except safari: array.filter( document.getelementsbyclassname('printarea_1'), function(elem){ $(".printing_list").printelement( elem ); }); i have tried adding chunk of code supposed make work safari, doesn't. can me work, or me write can replace works in browsers? here full print function function print_list(item_names,number_of_items) { var thetext="<ol>"; for(var i=1; i<=number_of_items;i++){ if($("#" + item_names + "_" + i).val()!=''){ thetext+="<li>" thetext+=$("#" + item_names

CSS ul li if remove 1 make others bigger -

Image
the height of ul 500px. how can make li height dynamic number of li there are? example, if have 5 li , height 20%, if 4 li , changes 25%. here tried, if remove 1 element "developer mode", height doesn't change. ul{ list-style:none; height:500px; width:100%; overflow:hidden; } li{ width:100px; height:25%; background:red; border:1px solid black; } http://jsfiddle.net/crcb8/ a little jquery need, , supported majority of browsers , mobile devices $(document).ready(function () { var x = $('li').siblings().length; var y = 100/x; $('li').css('height', y + '%'); });

performance - Delayed jQuery slideToggle animation -

Image
i have custom accordion menu. display second-level options in menu, chose use slidetoggle() . reason, there delay between when click , when animation occurs. this evident when seen in contrast accordion menu on same page... found out function bound (on click) menu item gets executed immediately. problem slidetoggle animation seems start later should. i believe may happening because of way targeting element slidetoggle() being called on. var $expandablemenu = $(".expandable .level1"); $expandablemenu.bind('click', function () { $(this).next().slidetoggle(200, function () { $(this).parent().toggleclass("opened"); }); }); maybe problem $(this).next() slow way target element need use slidetoggle() on? what thoughts? edit: made jsfiddle test case... oddly enough issue not happen here. http://jsfiddle.net/nyznp still looking issue. if trying

visual studio 2010 - Missing standard C libraries in cl -

i have windows project came makefile.vc. import visual studio 10.0. initial effort run nmake , invoke cl.exe compiler. after getting paths straights first run generates message: cl /nologo /w3 /o1 -i..\./ -i..\charset/ -i..\windows/ -i..\unix/ -i..\macosx/ /d_windows /d_win32_windows=0x500 /dwinver=0x500 /dhas_gssapi /dsecurity _win32 /c ..\be_all_s.c be_all_s.c ..\be_all_s.c(6) : fatal error c1083: cannot open include file: 'stdio.h': no such file or directory nmake : fatal error u1077: '"c:\program files (x86)\microsoft visual studio 10.0\vc\bin\cl.exe"' : return code '0x2' stop. now know vc stdio.h header is, on pc it's @ c:\program files (x86)\microsoft visual studio 10.0\vc\include. simple matter add -i makefile , include directory. but durn burn don't think should have to! other build systems don't make me , why doesn't command line compiler know standard headers installed? i'm asking if there's confi

How long does it take for BBOS 10 app to get approved by Blackberry App World? -

i search around forum. people said takes 2 weeks, these topics quite old , old blackberry os (5,6,7). so wonder how long takes bbos 10 apps? thanks in advance. it depends. sometimes, gets approved in couple of days, sometimes, in couple of weeks. depends on number of applications have evaluate @ time.

mysql - SQL: Designing tables for storing agendas/schedule -

i'm trying create weekly (monday - sunday) schedule/agenda, similar google calendar, using mysql users able fill out , display schedule tasks have @ day during hour interval. example user task store in schedule username | day | time | task jimbob, tuesday, 13:00, eat super delicious spaghetti. i'm wondering best way design tables? i create table every day of week, or have 1 big table store info day of week. if have million users, 1 big table performance issue? also, field of tables planning make 1 row store 1 task each hour, store tasks each hour of day. latter result in lot of null values , take more memory, if users fill out lot of calendar seems reduce lot of rows, , redundant username entries. makes easier print out schedule. thoughts? username | hour | task| or username | 12am |task1 | 1am | task2 | 2am .... thanks. the best way this, imo, have 2 tables: 1 users , 1 tasks . users have user id, username plus whatever else. tasks ha

html - Two divs side by side with one div absolute -

so have html <div class="app-wrapper"> <div class="search-form"/> <div class="results"> <div class="tabs"/> </div> </div> search-form has absolute positioning , floated left. want tabs appear next it, @ top of page. note doesn't have tabs on screen(fixed not required). right have .search-form { position: absolute; width: 30%; min-width: 200px; max-width: 350px; height: 100%; min-height: 600px; float: left; } .tabs { position: fixed; border-bottom: 1px solid @section-border; width: 70%; height: 3.0em; float: right; left: 31%; background: @tabs-background; } but doesn't work because on larger screens distance between tabs , search-form expands. how tabs next search-form, fills rest of page, , distance between tabs , search-form not depend on screen size? so realized tabs inside of div, css .results { width: 70%; } maybe looking for: ht

javascript - Socket.io emits to non-existing room -

i'm writing game , using socket.io. every map in game represented room in socket.io. it works this. user runs client , joins main room (lobby) empty room "" in socket.io, there, user can create room, roomid number, starting 0 (0,1,2,3, etc). when user joins room, starts timer - countdown till end of current map. __starttimer:function() { this.__timerid=setinterval(this.__ontimertick.bind(this), 1000); }, __ontimertick:function() { var string="timer event in room "+this.__roomid+", list of socket.io rooms:"; console.log(string); console.log(g.socketio.sockets.manager.rooms); this.__duration--; g.socketio.sockets.in(this.__roomid).emit(g.messages.fight_timer_tick_event, {time: this.__duration}); if(this.__duration==0) { clearinterval(this.__timerid); this.__fightend(); } }, the problem that, when users close client, leaves room, , if there no more users in room, destroyed. when user runs cl