Posts

Showing posts from March, 2012

javascript - how to reload same page after change the select box option -

how reload same page after change select box option. i have used shopping cart framework.in need update cart price when changed product attributes , so need reload same page when select box onchanged. <tr><td> <select name="color" onchange=""> <option value="red"> red </option> <option value="red"> blue</option> <option value="red"> green</option> <option value="red"> pink</option> </select> </td></tr> use this <tr><td> <select name="color" onchange="location.reload()"> <option value="red"> red </option> <option value="red"> blue</option> <option value="red"> green</option> <option value="red"> pink</option> </select> </td></tr>

ajax - jQuery effects doesn't work when I refresh the page next time -

i use jquery , ajax. when refresh page, jquery ui effects applied ajax response. but when send post back, jquery ui effects don't apply new response. i can't figure out what's wrong code. here code $(document).ready(function() { $("#sendemp").click(function(e) { e.preventdefault(); var submit_val = $("#searchbox").val(); //alert('submitval ' + submit_val); $.ajax( { type : "post", //datatype :"jason", url : "./wp-admin/admin-ajax.php", data : { action : 'employee_pimary_details', user_name : submit_val }, success : function(data) { // alert('hhh'); $('#accordion21').html(data); // $( "#searchbox" ).autocomplete({ ...

fortran77 - Reading a file with 1024^3 data points -

i trying read file 1024^3 single precision data points. code looks this real, allocatable :: stored_data(:) character(255):: in_file integer n integer*8 length, length4 length = n*n*n ! number of data points length4 = 4*length in_file = "filename.dat" allocate(stored_data(length)) open(10,file=trim(in_file),access="direct", & form="unformatted",recl=length4) read(10,rec=1) stored_data close(10) deallocate(stored_data) but when running code, following error: fortran runtime error: recl parameter non-positive in open statement i guess because of large value of variable "length4". workarounds?

c# - SignalR always using longpolling -

i using signalr 2.0 beta. chrome, firefox, , ie10 see transport being used longpolling. http://localhost:8080/signalr/poll?transport=longpolling&connectiontoken=123456 i running hub windows service, , have javascript hub proxies making connections client. server-side code: webapp.start<startup>("http://*:8080"); public class startup { public void configuration(iappbuilder app) { var config = new hubconfiguration { enablecrossdomain = true }; app.maphubs(config); } } client-side code: function configuremessaging() { var connectionmain = $.hubconnection('http://localhost:8080'); connectionmain.statechanged(connectionstatechanged); connectionmain.start({ waitforpageload: false, xdomain: false, jsonp: false }); var vmgrhub = connectionmain.createhubproxy("vmgrhub"); $("#broadcast").click(function () { vmgrhub.invoke('globalmessage', $("#msg").val()); }); vmgrhub.on('a...

Android listview with expandable list view item -

i want have listview menu few clickable elements , last element must expandable list view item. mean when click last element, additional positions should expanded. thank you! dejvid you have 3 options. use expandablelistview every group-item have no childs-item , last group-item have child-items (they expanded when parent group clicked), there many examples arround. example of expandablelistview use listview , inflate views on last item when called getview, know when loading last position because receive on function. example of listview if number of items low consider using linearlayout listview , linearlayout last item. for example <linearlayout android:orientation="vertical"> <textview /> <textview /> <linearlayout android:orientation="vertical" android:onclik="expand"> <textview /> <textview /> </linearlayo...

sql server - How to convert SQL Left Join query to Linq to Entity in C#? -

i have table: material(id,name,materialparentid) select c1.id,c1.name parentname,c2.id,c2.name material c1 left join material c2 on c1.id = c2.materialparentid id parentname id name 1 aluminium 2 cavity 1 aluminium 3 copper 1 aluminium 4 flooring 2 cavity null null 3 copper null null 4 flooring null null 5 glass null null i want convert above sql query linq query using liq entities. help appreciated! if table reading create view , when using reverse engineering make sure have views imported. or if did want done in linq here msdn example var innerjoinquery = cust in customers join dist in distributors on cust.city equals dist.city select new { customername = cust.name, distributorname = dist.name }; this how yours look var material = m in db.materials join m2 in db.materials on m.id equals m2.materialparentid select new {parentid = m.id, parentname...

sql - Can a postgres function run alone without needing the client side to wait for a result? -

i know postgresql locks row while doing function because of transaction process. tried trigger function when last row of table unlock. let's take example: function_one() , function_two defined inside pg. my application use function_one() add data or update stuff whatever. when it's done, last row needed unlock , can launch other transaction if want. @ point want postgresql launch function_two() when function_one() done. thanks answer(s). edit : more informations i have tried put trigger on pg catalog did not work because had information needed view , can't trigger data of view. so release lock need 1 of following commands: commit; rollback; so if had code so: function_one(); commit; function_two(); that looking for. issue chaining functions in such way dictate when lock gets released.

pip - Python - download packages from own server -

i wonder how can force setup.py install command download packages (via pip) server. can pip server address every dependecies downloaded pip server. maybe solution pip.ini/pip.conf? tomek from docs , can use the: --use-mirrors --mirrors <url> flag in pip specify mirror use. from command line, can speicify mirrors. example: pip install -i http://d.pypi.python.org/simple $package

gmail - VTiger User Incoming Mail System Error (Failure) -

i setting vtiger 5.4 installation , when configuring user incoming mail gmail, red "system error (failure)" message when attempting save new mail account. new vtiger so, pretty no idea start! thanks in mail manager module? click on settings. use 'select organization type' selector , choose gmail. should configure of settings.

Hierarchal Menu in PHP from Array -

alright, it's hump day, , brain's shot. can tell me i'm doing wrong here, i'm trying build navigation list (hierarchal) here's array: array ( [0] => array ( [contentid] => 1 [parentid] => 0 [linkalias] => ) [1] => array ( [contentid] => 2 [parentid] => 0 [linkalias] => inner ) [2] => array ( [contentid] => 3 [parentid] => 2 [linkalias] => inner-2 ) [3] => array ( [contentid] => 4 [parentid] => 3 [linkalias] => inner-21 ) ) and attempts @ recursive function: // parse out array displaying multi-level menu private function parsemenu($menu, $parent = 0){ $ret .= '<ul>'; $ict = count($menu); for($i=0; $i < $ict; ++$i){ if($menu[$i]['parentid'] == $parent){ $ret .= ' <li...

ios - UIScrollview delaysContentTouches issue -

i have uiscrollview loaded uibuttons , on uibutton action have highlighted uiimage of each uibutton . if don't set delayscontenttouches no highlighted uiimage of uibutton not shown if touch uibutton fast. after set delayscontenttouches property no uibutton highlighted uiimage shown. now after setting delayscontenttouches property no uiscrollview . can not scroll uiscrollview dragging on uibuttons . how can resolve issue. please give me advise. thanks in advance. here's works me. subclass uiscrollview, , implement method: - (bool)touchesshouldcancelincontentview:(uiview *)view { return yes; } then set delayscontenttouches = no; voila! works home screen: highlights buttons immediately, still allows scrolling :)

php - Are these 2 soap headers the same? -

i've been told soap header must : <soap:envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:ws="http://ws.dgpys.deloitte.com"> <soap:header> <axis2:servicegroupid xmlns:axis2="http://ws.apache.org/namespaces/axis2"> urn:uuid:fa7eb13c84d91bc34b1373986557015 </axis2:servicegroupid> </soap:header> <soap:body> ... </soap:body> my soap header : <?xml version=\"1.0\" encoding=\"utf-8\"?> <soap-env:envelope xmlns:soap-env=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:ns1=\"http://ws.dgpys.deloitte.com\"> <soap-env:header> <ns1:servicegroupid> urn:uuid:fa7eb13c84d91bc34b1373986557015 </ns1:servicegroupid> </soap-env:header> <soap-env:body> ... </soap-env:body> mine doesn't work. searched solution couldn't find anything. how can fix this? or topics ...

linux - How do I append text to a file? -

what easiest way append text file in linux? i had at question , accepted answer uses additional program ( sed ) i'm sure there should easier way echo or similar. cat >> filename text, perhaps pasted in other source. or else entered @ keyboard, doesn't matter. ^d essentially, can dump text want file. ctrl-d sends end-of-file signal, terminates input , returns shell.

regex - PowerShell multiple string replacement efficiency -

i'm trying replace 600 different strings in large text file 30mb+. i'm current building script this; following question : script: $string = gc $filepath $string | % { $_ -replace 'something0','somethingelse0' ` -replace 'something1','somethingelse1' ` -replace 'something2','somethingelse2' ` -replace 'something3','somethingelse3' ` -replace 'something4','somethingelse4' ` -replace 'something5','somethingelse5' ` ... (600 more lines...) ... } $string | ac "c:\log.txt" but check each line 600 times , there on 150,000+ lines in text file means there’s lot of processing time. is there better alternative doing more efficient? any advice on appreciated, cheers. so, you're saying want replace of 600 strings in each of 150,000 lines, , want run 1 replace operation per line? yes, there way it,...

c# - Task.Factory.StartNew invoked on UI thread anyhow -

i have deal strange problem, @ least point of view. use task wait untill variable gets specific value , run continue part on ui thread again. problem before call startnew() , inside call managedthreadid same , freezes ui. here code: // managedthreadid here task.factory.startnew(() => { // , here same. while (isclosing) { thread.sleep(50); } }).continuewith((finishedtask) => { if (currentcontainer != null) { window = currentcontainer; } else { window = createballonwindow(); window.show(); } window.activate(); }, taskscheduler.fromcurrentsynchronizationcontext()); ideas? thanks christoph edit: most interesting me why happens not how around issue. want understand happens there... thank hints, i think got it. problem here taskscheduler.current default scheduler used when calling startnew() . , no combination when using taskscheduler.synchronizationcontext(). the case here (...

restore (target) window is empty in macrium reflect boot cd -

macrium reflect, version 5.1xx free has bug. users have same problem. http:// wilderssecurity.com/showthread.php?t=311023 http:// support.macrium.com/topic.asp?topic_id=3828 http:// support.macrium.com/topic.asp?topic_id=4766 wheni boot-ed linux rescue cd, choose image file, when clicked next, destination window empty, , can not select target disk - in window there shown nothing select. empty! in macrium forum, have found 1 answer ( havent tested): users need choose ide (in disk controller, inside bios). but! macrium rescue cd version 4.xxx sees normally! , used version 4.xx's rescue cd succeed! is there other fix version 5.xx? here macirum restore rescuecd version 4.xx , , you'd better use that, if cant see drives in destination window list. i dont know if developers fix that.. version 4 shows drives in restore/target window. fun - why version 5 cant see that?...

java - Eclipse QuickFix for multiple problems -

in eclipse there option quick fix problems clicking on 1 of them, , selecting quickfix. it happens have on 1 hundred entries same problem. '<>' operator not allowed source level below 1.7 because changed target level of project 1.7 1.6 i tried select of them in problems view , tried quick fix, fails following error message: the selected problems not have common applicable quick fix. this message wrong, there exists @ least 1 such common quick fix: insert inferred type arguments. which 1 use. my question is: did wrong because quickfixes not applied, or bug in eclipse? i think missing thing ( or feature not bug) in eclipse. never rely on quickfix correct code. my suggestion: better fix individually rather in bulk avoid runtime issues.

100% CPU usage on 1000 connection - Node.js, socket.io, clusters and Redis ... -

my chat works on 24 threads (2x 6 cores x5650 @ 2.67ghz) ... if there 1000 connections cpu usage (on every thread) grows 80-100% .... think wrong code ... node shouldn't generate such load 1000 connections. can please give me idea look my code: express = require('express') http = require('http'); cluster = require("cluster"); numcpus = require("os").cpus().length, port = 55678; usercount = 0; interv = false; redisstore = require("socket.io/lib/stores/redis"), redis = require("socket.io/node_modules/redis"), pub = redis.createclient(), sub = redis.createclient(), client = redis.createclient(), counter = redis.createclient(); counter.set('count',0); client.set('searching',0); client.del('freeusers'); if (cluster.ismaster) { (var = 0; < numcpus; i++) { cluster.fork(); } } else { app...

java - Use of recordAccess(this) in Entry<K, V> class -

while having inside hashmap class, came across method :- /** * method invoked whenever value in entry * overwritten invocation of put(k,v) key k that's * in hashmap. */ void recordaccess(hashmap<k,v> m) { } actually, method defined inside inner class of entry<k, v> i'm not able make out of comment. method ? ps : can see method being called inside's hashmap's putfornullkey() method private v putfornullkey(v value) { (entry<k,v> e = table[0]; e != null; e = e.next) { if (e.key == null) { v oldvalue = e.value; e.value = value; e.recordaccess(this); // call return oldvalue; } } modcount++; addentry(0, null, value, 0); return null; } update : i've updated first code snippet. a linkedhashmap can have 2 orders: insertion order, or access order. if access order used, me...

c# - Convert String to Type, where Type is a variable -

i attempting create standard method handle populating view model based on stored values in cookie, used user defaults search criteria. i having issues when comes converting string cookie values property type view model can updated appropriately. getting following error: invalid cast 'system.string' 'system.reflection.runtimepropertyinfo'. here have: public tviewmodel getusersearchcriteriadefaults<tviewmodel>(tviewmodel viewmodel) tviewmodel : class { type type = viewmodel.gettype(); string classname = viewmodel.gettype().name; propertyinfo[] properties = type.getproperties(); if (request.cookies[classname] != null) { string rawvalue; foreach (propertyinfo property in properties) { if (!string.isnullorempty(request.cookies[classname][property.name])) { rawvalue = server.htmlencode(request.cookies[classname][property.name]); type propertytype = p...

javascript - Value of variable to event listener -

task simple, experience not enough solving it. need use outer variable in eventlistiner. if try use outer variable, "undefined". seems solved closures, can't understand how works. wrong code: function myfunc(){ title = "head"; console.log(title);//head document.getelementbyid("test").onclick = function(){ console.log(title);//undefined } } right code: function myfunc(){ title = "head"; console.log(title);//head document.getelementbyid("test").onclick = function(){ //some magic... console.log(title);//head } } hope help. thanks. unfortunetly yours answers don't help. have tryed, if easy not write here. still, have made yourself: function myfunc(){ function cls(it){ return function(){ console.log(it); } } title = "head"; document.getelementbyid(...

regex - Selectively deleting commas and splitting strings -

i have s string looks like txt = '"emb","ishares j,p. morg",110.81,n/a' i'm using strsplit(txt,','); break separate strings based on comma delimiter. want ignore comma between 'j' , 'p' , since it's not delimiter; it's part of name. is there way can "if comma between 2 quotes there other characters between quotes, delete comma"? a silly (but functional) answer: inquotes=false; keep=true(1,length(txt)); v=1:length(txt) if (txt(v)=='"') inquotes=~inquotes; elseif (txt(v)==',' && inquotes) keep(v)=false; end end txt=txt(keep); tt=strsplit(txt,','); this will, if in quotes, remove commas can use strsplit. understood want do, correct?

registry - regedit and remove first part of string passed through to exe -

i have simple dialler programme trying associate tel & callto html tags when associate via registry: [hkey_current_user\software\classes\callto\shell\open\command] "c:\program files (x86)\mitel\unified communicator advanced 5.1\ucadialer.exe" "%1" it passes thorough information tag, ie: callto:07777123456 what results in dialler programme using following string: 922558607777123456 which after confusion turned out numbers on keys c l l t o . what therefore need trigger dialler pass through info after colon, missing letters of callto or tel . can done changing registry string? if not, there workaround? many in advance. i couldn't figure out how in registry string, ended writing powershell script , calling instead of ucadialer.exe. here's put hkcu\software\classes\callto\shell\open\command\(default) : "c:\windows\system32\windowspowershell\v1.0\powershell.exe" -file "c:\programmes\click2call.ps1" ...

asp.net mvc - How to use SelectList in View without a model? -

i have read many times experts of mvc saying if use selectlist, it's best have ienumerable<selectlist> defined in model. example, in question . consider simple example: public class car() { public string mybrand { get; set; } public ienumerable<selectlistitem> carbrands { get; set; } // sorry, mistyped, shoudl selectlistitem rather carbrand } in controller, people do: public actionresult index() { var c = new car { carbrands = new list<carbrand> { // , here goes options.. } } return view(c); } however, pro asp.net mvc , learned way of creating new instance. public actionresult create() // { return view() } [httppost] public actionresult create(car c) { if(modelstate.isvalid) // add database } my question is: how should pass selectlist view? since in method there no model existing, there seems no way this. using viewbag , told avoid using viewbag causes problems. i'm wond...

c# - Read cookie to login automatic -

i store cookies when logging in, below: list<user> listuser; //returns 1 user foreach(user u in listuser) { httpcookie cookienickname = new httpcookie("usernickname"); cookienickname.value = u.nickname.tostring(); cookienickname.expires = datetime.maxvalue; response.cookies.add(cookienickname); httpcookie cookiepassword = new httpcookie("userpassword"); cookiepassword.value = u.password; cookiepassword.expires = datetime.maxvalue; response.cookies.add(cookiepassword); } when visits site again, want read data database associated usernickname-cookie , userpassword-cookie. then want show firstname , lastname on label. this tried: list<user> cookieloggedinuser; if (request.cookies["usernickname"] != null && request.cookies["userpassword"] != null) { //returns 1 user cookieloggedinuser = database.signin(request.cookies["usernickname"].tostring(), request.cookies[...

php - How to access multiple properties with magic method(__get & __set)? -

i studied magic methods, __get , __set , , wondering how set , multiple properties in class. i know works 1 variable or array, i'm not sure accessing multiple variables. is there explain me? class mymagic2 { public $data; public $name; public $age; public function __set($item, $value) { $this->item = $value; } public function __get($item){ return $this->item; } } is there way access variables ( $data , $name , $age )? when work @ projects have these methods: public function __set($name, $value) { //see if there exists setter method: setname() $method = 'set' . ucfirst($name); if(!method_exists($this, $method)) { //if there no setter, receive public/protected vars , set correct 1 if found $vars = $this->vars; if(array_search("_" . $name, $vars) !== false) $this->{"_" . $name} = $value; } else $this->$method(...

entity framework - What's the name convention of many to many tables in EF -

i have many many relationship between table , table b, @ beginning, generated relationship table ab, however, after few updates, name change ba, want avoid that. know can use fluentconfiguration .totable specify name, there better way that? the default name ab or ba depends on order in dbset s of 2 entities declared in context class, on other entities refer 2 entities , in order metadata loaded context. results few tests here . in other words name swap 1 other whenever change soemthing in model or context class during development , hard control. specifying name fluent api best way have stable link table name doesn't change - , far can tell, way.

sql - why doesn't my nested insert statement work? -

insert mytable (id) values ( select id sometable seriesid not in (120, 130, 110, 300) ) i error message in ssms: msg 156, level 15, state 1, line 1 incorrect syntax near keyword 'select'. msg 102, level 15, state 1, line 1 incorrect syntax near ')'. if perform select in insert may skip values part insert mytable (id) select id sometable seriesid not in (120, 130, 110, 300)

php - How to set min(value) variable as 0 when no value is returned by the sql query -

$sql = "select min(id) sid table1 ...."; $result = mysql_query($sql); $row = mysql_fetch_array($result); $sid = $row['sid']; how can set $sid 0, when no value returned sql query (here id in table1 int type) please me.... if there no matching rows, min() function return null value, use coalesce or ifnull() turn zero: select coalesce(min(id), 0) sid ... select ifnull(min(id), 0) sid ...

c - Is there a way to detect that TCP socket has been closed by the remote peer, without reading from it? -

first, little background explain motivation: i'm working on simple select()-based tcp "mirror proxy", allows 2 firewalled clients talk each other indirectly. both clients connect server, , both clients connected, tcp bytes sent server client forwarded client b, , vice-versa. this more or less works, 1 slight gotcha: if client connects server , starts sending data before client b has connected, server doesn't have anywhere put data. don't want buffer in ram, since end using lot of ram; , don't want drop data either, client b might need it. go third option, not select()-for-read-ready on client a's socket until client b has connected. way client blocks until ready go. that more or less works too, side effect of not selecting-for-read-ready on client a's socket if client decides close tcp connection server, server doesn't notified fact -- @ least, not until client b comes along , server selects-for-read-ready on client a's socket, re...

java - how to make an if statement then send a message -

how make if input user yes, send messaage hunted cow! system.out.println("would hunt cow?"); system.out.print("yes or no?"); string = kbreader.next(); system.out.println("you hunted cow!") if (a.equalsignorecase("yes")) { ... } (or equals if want match "yes" exactly)

networking - How to Make a git Repository 'pull only' -

i setting development environment on shared server multiple developers. have 1 repository houses code used in production, , many others used development different members of team. production repo 'pull only'. users can pull , production changes locally whenever want, pushes need handled production admin, or @ least require password. like: [user@machine /devroot/myrepo]$ git pull $production master <location> *branch master -> fetch_head up-to-date [user@machine /devroot/myrepo]$ git push $production master error: user `user` not authorized action or [user@machine /devroot/myrepo]$ git push $production master head @ `$production`-please enter password: i believe file permissions, doesn't strike me elegant solution. git have built in? if want complex repository access controls, may want gerrit . primary focus code review (which totally worth having well!), access control side effect. otherwise, if want simple, file permissi...

Given an array of Strings, return true if each string could be connected to other -

you given array of strings, return true if , if strings can connected in 1 chain. condition connectivity is, if last character of 1 string matches first character of second string, 2 strings can connected . example : string []arr ={"abc", "cde", "cad" , "def" , "eac"} return true because strings can connected in 1 chain. "abc"->"cde"->"eac"->"cad"->"def" another example: string []arr ={"acb" , "cde", "def", "ead" } returns false because "cde"->"ead"->"def" possible chain “acb” left out. note : it's not necessary start first string , form chain, may happen won’t chain if start first string. can chain if start other string. if there exists possible chain, solution should return true. in second example, if first string suppose “fcb” , possible chain have existed, "cde"...

asp.net - Using < > in text for asp:DropDownList option -

i have following in .aspx file: <asp:dropdownlist id="title" width="350px" runat="server"> <asp:listitem value="0">please select</asp:listitem> <asp:listitem value="dr">dr</asp:listitem> <asp:listitem value="mr">mr</asp:listitem> <asp:listitem value="ms">ms</asp:listitem> <asp:listitem value="miss">miss</asp:listitem> <asp:listitem value="mrs">mrs</asp:listitem> </asp:dropdownlist> i put < > around "please select": <asp:listitem value="0"><please select></asp:listitem> however, file thinks opening new tag when use them. any ideas on how can use these, possibly escaping them etc.,? there's text attribute can use text instead of putting text between opening , closing tags: <asp:listit...

General Strategy: Data/Array Analysis in Python -

this strategy question. i completed task in vba , sql, not know how execute in python because i'm learning, , interested in general approach in python. i have 3 tables/matrices/arrays. names , ids: name nid amy 1 becky 2 cathy 3 dana 4 objects associated names , date: oid names date 1a amy, cathy 3/1/2012 2x dana 3/1/2011 4s amy, becky 3/1/2010 date ranges associated nids: nid start end 3 1/1/2012 1/1/2013 the question want answer is: every nid in last matrix, oids relevant (i.e. name appears in object , date falls within date range given name in final matrix)? it's broad question, ecstatic execute kind of task in python if possible. please note few 1 , many 1,000 distinct names can assiacted oid. why wouldn't keep data in sql database? sql suited handling kind of operations want perform , seems you're familiar it. doing has added advantage of portability, can switch between vba , python wit...

c++ - Is there no GetFilePointer(Ex) Windows API function? -

i trying debug program manipulates file. example, set file-pointer offset 4 (using base of 0), seems starting @ offset 5 instead. to try figure out happening, want put in line print out current file pointer (i’m not using ide little project, notepad2 , command-line). unfortunately there not seem windows api function retrieve current file pointer, 1 set it. i’m recall being able find current file pointer in pascal (in dos), how can current file pointer determined in c++ in windows? unlike functions, provide both getter , setter (in read-write sense), there indeed no getfilepointer or getfilepointerex . however value can retrieved calling setfilepointer (ex) . 2 setfilepointer functions return return/output setfilepointer , have make sure specify offset of 0 , and file_current mode. way, moves 0 bytes is, returns (i can’t vouch whether or not wastes cpu cycles , ram perform zero-move, think have optimized not so). yes, inconsistent , confusing (and redundant , ...

handsontable how is it possible to change the scrollbar next to the table -

i need change how scrollbar displayed in handsontable. knows how this? function walkontablescroll(instance) { this.instance = instance; this.wtscrollbarv = new walkontablescrollbar(instance, 'vertical'); `enter code here`this.wtscrollbarh = new walkontablescrollbar(instance, 'horizontal'); } if want scrollbars, set container width, height , overflow: scroll in css. $example1.handsontable({ data: createbigdata(), colwidths: [55, 80, 80, 80, 80, 80, 80], //can number or function rowheaders: true, colheaders: true, minsparerows: 1, stretchh: 'all', contextmenu: true, width: 100, height: 100 }); see here more detail

resolution - iOS Splash Screen Stretched -

setting splash screen app (320x480, 640x960, etc), yet seems stretched in y-axis. thought might case of having uistatusbar re-created splash screens @ smaller resolution (320x460, 640x920, etc) yet i'm still experiencing same issue. thoughts?

php - PostgreSQL: Create schema in specific database [NOT psql] -

im trying create sql file import database/schema/tables php. if use pgadmin, inserts meta-command \connect after create table , generates error if run sql pg_query in php. after read following questions: postgresql: create schema in specific database , postgres creating schema in specific database i ask: how can create new schema, inside specific database, sql commands (not psql commands)? specific database not default named 'postgres' database, created me. the short answer if connected database can't pure sql. due fact there no use database; in postgres in mysql have open connection specific database want create schema in (e.g. pg_connect in php). the schema can created create schema... sql command might know. perhaps working pg_dump , pg_restore option you. have @ sources of phppgadmin . i hope helped bit. *jost

asp.net mvc - Nested Object Form with Razor -

im trying implement way how enter recipes correctly, far have following: recipe.cs public class recipe { [key] public int recipeid { get; set; } [required] public string name { get; set; } public string subtitle { get; set; } public int serving { get; set; } public string instructions { get; set; } public virtual icollection<ingredient> ingredients } ingredient.cs public class ingredient { [key] public int ingredientid { get; set; } public string name { get; set; } public string amount { get; set; } public virtual icollection<recipe> recipes { get; set; } } in form, want add ingredients inline, javascript rendering new pair of fields if needed. (the viewmodel nothing else class holding instance of recipe) create.cshtml @model vineyard.webui.areas.admin.models.recipeviewmodel <div class="span9"> <h2>create new recipe</h2> @using (@html.beginform("create...

ruby on rails - Undefined method `arel_attributes_values' for class `ActiveRecord::Base' -

Image
when try run $ rails console i following error /usr/local/lib/ruby/gems/2.0.0-p247/gems/activesupport-4.0.0/lib/active_support/core_ext/module/aliasing.rb:32:in `alias_method': undefined method `arel_attributes_values' class `activerecord::base' (nameerror) ............. other errors follow... tracebacks my versions follows $ gem -v 2.0.5 $ ruby -v ruby 2.0.0p247 (2013-06-27 revision 41647) [x86_64-linux] $ rails -v rails 4.0.0 $ rvm -v rvm 1.21.11 (stable) wayne e. seguin <wayneeseguin@gmail.com>, michal papis <mpapis@gmail.com> [https://rvm.io/] $ uname -a linux cdv-web01 2.6.18-274.el5 #1 smp fri jul 8 17:36:59 edt 2011 x86_64 x86_64 x86_64 gnu/linux do have install gem don't know about? update: included whole traceback... warning: nls_lang not set. fallback us7ascii. /home/aayerd200/.rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.0/lib/active_support/core_ext/module/aliasing.rb:32:in `alias_method': undefined method `arel_attr...

actionscript 3 - Adding(removing) data from XML to list -

i want add data dynamically xml class list. xml class this: <?xml version="1.0" ?> <persons> <person id="1" > <firstname>anthony</firstname> <lastname>robbins</lastname> </person> <person id="2" > <firstname>deil</firstname> <lastname>carnegie</lastname> </person> <person id="3" > <firstname>bill</firstname> <lastname>cosby</lastname> </person> <person id="4" > <firstname>albert</firstname> <lastname>einestein</lastname> </person> <person id="5" ...

ASP.NET MVC 5 (Visual Studio 2013 Preview) Change Login Url for [Authorize] -

hey guys started playing around asp.net mvc 5 preview , has been going fine far (i can recommend it). however, wonder can set login-url built-in [authorize] -attribute. i've moved accountcontroller area, path login action no longer /account/login myarea/account/login , ignored [authorize] -attribute, in turn means, whenever 1 navigates controller or action attribute set, 1 redirected wrong path /account/login . look in web.config section this: <authentication mode="forms"> <forms loginurl="~/account/logon" timeout="2880" /> </authentication> change loginurl value point updated login page.

Swapping out a class for another in jQuery -

i'm having difficulty changing class of button element using jquery. currently, adds class button element. this code far. how can resolve it? $(function () { $("#admin").click(function () { $('#normal').show(); $('#admin').hide(); $('.delete_admin').toggleclass("delete_normal"); return false; }); $("#normal").click(function () { $('#normal').hide(); $('#admin').show(); $('.delete_normal').toggleclass("delete_admin"); }); }); if elements starts out 1 class, toggle both classes, removing existing one, , adding new one, so: $(function () { $("#admin").click(function () { $('#normal').show(); $('#admin').hide(); $('.delete_admin').toggleclass("delete_normal delete_admin"); return false; }); $("#normal...

asp.net - in vb.net, why do I get an error when reading mysql query results? -

wasn't sure how phrase question.. let me explain problem, querying table has book value , cancel value, following: select book_value, cancel_value, (book_value - cancel_value) total_value mytable in mysql workbench, want. now, when query vb.net, following error: system.invalidcastexception: conversion string "total_value: " type 'double' not valid. ---> system.formatexception: input string not in correct format. @ microsoft.visualbasic.compilerservices.conversions.parsedouble(string value, numberformatinfo numberformat) @ microsoft.visualbasic.compilerservices.conversions.todouble(string value, numberformatinfo numberformat) --- end of inner exception stack trace --- @ microsoft.visualbasic.compilerservices.conversions.todouble(string value, numberformatinfo numberformat) @ microsoft.visualbasic.compilerservices.operators.addobject(object left, object right) @ cust_info_default2.page_load(object sender, eventargs e) in line 32 oka...

javascript - display array data in sorted order -

i trying display multi dimensional array in 3 columns alphabetical order, able sort array. currently list displayed as: amanda brad lisha madley mowaki but, want result below format amanda lisha mowaki brad madley here fiddle html: <div> <div class='main'></div> <div id='description'></div> </div> js: $(function () { function compare(a, b) { if (a.name < b.name) return -1; if (a.name > b.name) return 1; return 0; } data.sort(compare); (var = 0; < data.length; i++) { var dataitem = "<a href='#' class='dataitem' data-description='" + data[i].desc + "'>" + data[i].name + " <strong>(" + data[i].age + ")</strong>" + "</a>"; $('.main').append(dataitem); //alert(data[i]['name']); if (i % 3 == 2) { ...

Convert from Javascript to Typescript -

how convert function javascript typescript? var toggleswitch = this.toggleswitch || (function () { //code } i know var toggleswtich part can written export class toggleswitch {} , i'm not sure rest of line. if write module, you'll end identical code... module toggleswitch { } modules can extended in typescript. difference compiler know whether module declared or not, saves test. to take example further, here example toggleswitch declared twice, different contents. you'll notice can access contents. can split across multiple files: module toggleswitch { export class { go() { alert('a'); } } } module toggleswitch { export class b { go() { alert('b'); } } } var = new toggleswitch.a(); var b = new toggleswitch.b(); a.go(); b.go();

osx - Clang removing dead code during static linking (gcc equivalent of -Wl, --gc-sections) -

i'm linking against static library , wonder how 1 should handle stripping of dead code in llvm/clang. can't find documentation hints clang has equivalent of -wl, --gc-section or -dead_strip. i assume dead code elimination performed automatically @ higher optimisation levels, that's case in gcc too, right? yet, gcc provides explicit control of via above mentioned flags. clang not provide or missing something? (the system osx) dead stripping linker feature, not compiler feature. neither gcc nor clang have it, result. that's why had use -wl - you're passing flag linker. mac os x linker uses -dead_strip . can pass flag directly clang invocation , pass through automatically.

java - Looking for duplicate values in a 2 dimensional array -

the assignment working on requires create sudoku game without using classes, methods, encapsulation, etc. new java bare me. having trouble validating values user inputs either "fourarray" or "ninearray" contains no duplicate values. far have been trying use nested for-loop in order iterate through both columns , rows of either array. example, have been trying include following piece of code @ end of program determine if there duplicate values: for (int = 0; < fourarray.length; i++) { (int j = + 1; j < fourarray.length; j++) if (fourarray[i] == fourarray[j]) { system.out.println("no sudoku"); } else { system.out.println("sudoku!); } } however not working. want iterate through arrays find duplicate values, , if there none, print out "sudoku!" if there duplicate values, want print out "sudoku!" need sort array @ all? or there method not aware of? have included program....