Thursday, 16 January 2014
Utah's Huge Roadside Crosses Must Come Down
1.Utah's Huge Roadside Crosses Must Come Down
Description:11-11-2011 · Now I'm hearing the Mormons aren't much into
crosses, so the crosses aren't really religious there. Also speculation
that we may be protesting ...
2.Judge asked to sign final order in highway cross dispute
Description:17-01-2012 · ... Final settlement papers in a lawsuit over 14
roadside crosses honoring Utah ... the crosses must come down ... Court
papers say the amount must be ...
3.Utah Local News - Salt Lake City News, Sports, Archive - The ...
Description:16-09-2010 · Utah's independent news source since ... roadside
crosses memorializing fallen troopers must come down. ... the crosses do
not endorse religion but remind ...
4.Utah highway crosses removed to be refurbished and placed on ...
Description:Utah will be without roadside crosses honoring fallen state
... The last two were to come down ... the UHP and the UHPA must pay
American Atheists $ ...
5.Supreme Court Turns Down Utah Crosses Case | CitizenLink
Description:31-10-2011 · Supreme Court Turns Down Utah Crosses Case ...
Utah's roadside memorials aren't the only crosses that come under the
ruling: ...
6.Parties in Utah memorial-crosses case submit settlement ...
Description:... agreement will mean 14 roadside crosses honoring Utah
troopers ... the crosses must come down by ... Court papers say the amount
must be approved by state ...
7.Utah highway crosses to be removed, placed on private land ...
Description:13-01-2012 · Utah will be without roadside crosses honoring
fallen ... The last two were to come down ... the UHP and the UHPA must
pay American Atheists ...
8.Utah Highway Patrol Association v. American Atheists resource ...
Description:... Fallen Utah troopers struck down twice ... colleagues, and
many more must suffer ... the Supreme Court specifically addressed the
subject of roadside crosses ...
9.Roadside crosses for fallen Utah police unconstitutional ...
Description:19-08-2010 · ... Roadside crosses for fallen Utah police ...
one of them birds is really really huge, ... laying down the bad for the
good is a must, ...
10.The Unreligious Right
Description:... turns-down-utah-roadside-cross-case-20111031-NCX">refused
to hear a case</a> involving 12-foot metal crosses on Utah ...
03/giant-roadside-crosses.html">here ...
Forum Discussion: Living the Simple Life
1.Forum Discussion: Living the Simple Life - Agnosticism ...
Description:26-10-2011 · Romanticizing the Simple Life Nicole Richie &
Paris Hilton Premiere party for 'The Simple Life' Photo: Doug Benc/Staff /
Getty
2.Simple Living Forums hosted by New Road Map Foundation
Description:Financial Integrity / Simple Living discussion forums provided
by the New Road Map Foundation. ... Your Money or Your Life, by Joe
Dominguez and Vicki Robin. ...
3.The Simple Living Network - SimpleLiving.net
Description:The Simple Living Network: Providing resources, ... truly
simplifying my life would be. ... who have generously offered to keep the
Discussion Forums alive at: ...
4.Simple Living Forums
Description:Simple Living Forums; ... Friendly discussion of government
and social issues as they relate to simple living. ... Simplify your
business life, ...
5.simple living, simple living magazine, simple living network ...
Description:Christian Simple Living is a way of life that is based on
Jesus' teachings of compassion, love, and service. ... Simple Living
Discussion Forums. Forum.
6.The power Of Certainty-a simple guide to living the life of ...
Description:Hello everyone, I am new to this forum. I just published my
first self help/personal growth book called The Power Of Certainty which
basically establishes how one can ...
7.Forum Discussion: What's the Purpose of Life?
Description:02-10-2013 · Add your thoughts to the comments here or join
the ongoing discussion in the forum ... by simple observation. Just ...
than living your life to the ...
8."Living the Simple Life" | Discussion Boards - Christian ...
Description:... online profiles and discussion boards. Member Login;
Members Area; ... "Living the Simple Life" ... bombarding a forum with
your posts can be boring, ...
9.Living the Real Simple Life (ABC Nightline) - Survivalist Forum
Description:Living the Real Simple Life (ABC Nightline) Farming, Gardening
& Homesteading
10.Are you living your ideal simple life? - Mommysavers
Description:I think it would really help to find simple living mentors
that have are successfully and joyfully living the simple life. ... Back
to Forum: Simple + Green Living ...
Wednesday, 15 January 2014
End of Idi Amin to the Relaunch of the East Africa Community
1.Uganda Timeline -- Part 3: End of Idi Amin to the Relaunch of ...
Description:... End of Idi Amin to the Relaunch of the East Africa
Community ... Uganda rekindles the East African Community ... What Caused
the Scramble for Africa?
2.Uganda Timeline -- Part 4: Relaunch of the East African ...
Description:... Relaunch of the East African Community to ... is brought
to an early end when the constitutional court ... Idi Amin to the Relaunch
of the East Africa ...
3.Idi Amin & East Africa - First thoughts about
Description:Comments about Idi Amin and East Africa. ... for the rural
community in the East African Community and educate ... formed the
southern end of trans ...
4.Idi Amin - Wikipedia, the free encyclopedia
Description:... East Germany attempted to remove evidence of its
involvement with these ... Idi Amin Dada: Hitler in Africa (1977) ...
Community portal; Recent changes; Contact ...
5.Idi Amin - Biography - IMDb
Description:Idi Amin Dada Oumee was born in the ... At the end of the war
Amin joined the British 4th ... supposedly the beginning of his plan to
conquer all of Africa for ...
6.allAfrica.com: Uganda: Idi Amin, Islam and Muslims in Uganda
Description:17-04-2013 · East Africa. Burundi Comoros ... The colonial
period was a very challenging one for the Muslim community. ...
participate in bringing Idi Amin into power ...
7.Idi Amin - Uganda Short-term Mission Guide
Description:The economic war that Idi Amin Dada started as ... to Rhodesia
and cause an end to apartheid in Southern Africa. ... a reluctant
international community, ...
8.Cloak and dagger: How 'new' East Africa was born out of ...
Description:... How 'new' East Africa was born out of the fires . ...
Presidents of East African Community member ... Uganda's military ruler
Gen Idi Amin invades ...
9.Amin, Idi
Description:Amin, Idi. I. Introduction. ... (the British army's East
African corps) ... Editor of Civil Society and Democracy in Africa:
Critical Perspectives.
10.An agent of death dies / Idi Amin's infamous rule hurt Uganda ...
Description:An agent of death dies / Idi Amin's ... in East Africa, the
East African Community, ... work in community with Mr. Amin's Uganda, in
the end it was ...
This Day in African History: April 21
1.This Day in African History: April 21
Description:A chronicle of events in African history on 21 April. ...
1619, 21 April Birth of Jan Anthoniszoon van Riebeeck in Culemborg,
Netherlands.
2.This Day | History - History.co.uk | Shows, Videos, Topics and ...
Description:... Africa, to establish a missionary hospital in Lambarene.
... This day in history. prev; April;
3.This Day in African History -- Rwandan Genocide
Description:21-04-2013 · On 21 April 1994 the first reports of the Rwandan
genocide are starting to appear in the international press. Find out more
about how survivors of the ...
4.This Day in History: April 21 | Infoplease.com
Description:Day in History; Home; World. Countries; Atlas; News; History;
... April 21: Yesterday Tomorrow: 1836. ... or choose another day:
5.This Day in History — History.com — What Happened Today in ...
Description:Like This Day In History on Facebook. Also on This Day ...
Johnson appoints first African-American cabinet member ... April May. 1;
2; 3; 4; 5; 6; 7; 8; 9; 10; 11; 12 ...
6.Today in History | South African History Online
Description:... was born in Culemborg in the Netherlands on 21 April 1619.
... This Day in History Extra Dates ... Copyright © South African History
Online ...
7.April 21 Famous Birthdays, Deaths and Events - On This Day ...
Description:Explore the famous events, notable birthdays and celebrity
deaths of April 21 with On This Day, on Biography.com.
8.This Day | History - History.co.uk | Shows, Videos, Topics and ...
Description:This Day; Topics. History of South Africa; History of WW2; ...
This day in history. prev; April;
9.Today in History | South African History Online
Description:The post offices at Waldau and the Waterberg in German South
West Africa ... to see historic events that happened on that day ... South
African History Online ...
10.This Day In History: April 21 (The World Almanac)
Description:... April 22 » This Day In History: April 21. ... Lee Elder
became the first African American to be ... The previous post in this blog
was This Day In History: April ...
I Didn't Do It For You
1.You Made Me Love You
Description:bing.com/videos
2.Bart Gets Famous - Wikipedia, the free encyclopedia
Description:I didn't wanna do it I didn't wanna do it You made me want you
... I didn't wanna tell you I didn't wanna tell you I want some love
that's true Yes, I do, 'deed I do
3.You Made Me Love You - Wikipedia, the free encyclopedia
Description:Bart becomes an accidental star when he says, "I didn't do it"
during the botched sketch. ... By using this site, you agree to the Terms
of Use and Privacy Policy.
4.Poetry 180 - She Didn't Mean to Do It (Library of Congress)
Description:You Made Me Love You may refer to: You Made Me Love You (I
Didn't Want to Do It), a 1913 song, written by James V. Monaco, the lyrics
by Joseph McCarthy You Made Me ...
5.WISH I DIDN'T MISS YOU LYRICS - ANGIE STONE
Description:... She Didn't Mean to Do It : The Library of Congress ... on
your sheets on your bed in your room and you fade and they fade. You
falter and they're gone, ...
6.do and did - Learn American English Online
Description:"Wish I Didn't Miss You" Lyrics by Angie Stone: ... Isn't it
ironic all you wanna do is smoke chronic Boy, you forgot when you were
down Who was around [1] ...
7.I didn't mean to hurt you - YouTube
Description:You didn't ____ He did not ____ He didn't _____ ... She didn't
do her grocery shopping yesterday. They do not do their homework at the
library.
8.KELLIE PICKLER LYRICS - Didn't You Know How Much I Loved You
Description:Oh no, I didn't want to hurt you I'm just a jealous guy, watch
out ... 4:17 Bryan Adams - (Everything I Do) I Do It For You by Bryan
Adams 92,365,824 views;
9.LiL Rain - Adore you. - YouTube
Description:Lyrics to "Didn't You Know How Much I Loved You" song by
KELLIE PICKLER: ...
10.You - Uncyclopedia, the content-free encyclopedia
Description:... on my knees for you for your love i do it for your sake
believe i do ... you got it wrong i didn't wanna hurt you i wanna be all
the world to you ...
Olduvai Gorge -- What is Olduvai Gorge
1.Olduvai Gorge - Wikipedia, the free encyclopedia
Description:Olduvai Gorge is one of the most important
paleoanthropological sites in the world and has been instrumental in
furthering the understanding of early human evolution.
2.OGAP - Olduvai Geochronology and Archaeology Project
Description:Olduvai Gorge, in northern Tanzania, is internationally
recognized for Louis and Mary Leakey's famous discoveries of early humans
and magnificent antiquities ...
3.What is Olduvai Gorge? » Olduvai Gorge
Description:bing.com/images
4.Olduvai Gorge - Simple English Wikipedia, the free encyclopedia
Description:The spectacular landscape of northern Tanzania, where Olduvai
Gorge is situated, is the product of both abrupt high-energy processes
like volcanism and plate ...
5.The Olduvai Gorge Research Project
Description:The Olduvai Gorge is a steep-sided ravine in the Great Rift
Valley that stretches through East Africa. It is in the eastern Serengeti
Plains in northern Tanzania.
6.Rift Valley Photographic Lodge | Olduvai Gorge
Description:Introduction to the Olduvai Gorge Project. The Olduvai
Paleoanthropology and Paleoecology Project started in 2006 and its goal is
to study the origins of human behavior.
7.Olduvai - Wikipedia, the free encyclopedia
Description:Olduvai Gorge. Olduvai Gorge is the situated in the plains
area. It is considered the seat of humanity after the discovery of the
earliest known specimens of the ...
8.Olduvai gorge | Define Olduvai gorge at Dictionary.com
Description:Olduvai may refer to: Olduvai Gorge Seven Views of Olduvai
Gorge Olduvai Gorge Museum Olduvai Hominid 8 Olduvai theory Olduvai,
Research Facility on Mars in the Doom ...
9.Olduvai Gorge Tour - Oldupai Gorge - Shifting Sands Ngorongoro
Description:Olduvai Gorge (ˈɒldʊˌvaɪ) —n: a gorge
in N Tanzania, north of the Ngorongoro Crater: fossil evidence of early
man and other closely related species, together ...
10.Olduvai Gorge, Tanzania - About.com Archaeology
Description:Olduvai Gorge is the Archaeological Site in the north-east of
Tanzania within Ngorongoro Conservation Area, in which early human fossils
were first ...
algorithm - What's the purpose of BFS and DFS? -
algorithm - What's the purpose of BFS and DFS? -
i've learned how these algorithms work, used for?
do utilize them to:
find node in graph or to find shortest path or to find cycle in graph?
both of them visit nodes , mark them visited, , don't see point of doing that.
i sort of lost here learning.
bfs , dfs graph search algorithms can used variety of different purposes.
one mutual application of 2 search techniques identify nodes reachable given starting node. example, suppose have collection of computers each networked handful of other computers. running bfs or dfs given node, find other computers in network original computer capable of straight or indirectly talking to. these computers come marked.
bfs can used find shortest path between 2 nodes in unweighted graph. suppose, example, want send packet 1 computer in network another, , computers aren't straight connected 1 another. along route should send packet arrive @ destination possible? if run bfs , @ each iteration have each node store pointer "parent" node, end finding route start node each other node in graph minimizes number of links have traversed reach destination computer.
dfs used subroutine in more complex algorithms. example, tarjan's algorithm computing strongly-connected components based on depth-first search. many optimizing compiler techniques run dfs on appropriately-constructed graph in order determine in order apply specific series of operations. depth-first search can used in maze generation: taking grid of nodes , linking each node neighbors, can build graph representing grid. running random depth-first search on graph produces maze has 1 solution.
this no means exhaustive list. these algorithms have sorts of applications, , start explore more advanced algorithms find relying on dfs , bfs building blocks. it's similar sorting - sorting isn't interesting, beingness able sort list of values enormously useful subroutine in more complex algorithms.
hope helps!
algorithm graph depth-first-search breadth-first-search
wpf - Binding combobox selected value to property -
wpf - Binding combobox selected value to property -
i have enum animals fish , cat values inside.
public observablecollection<animalsenum> animals { get; set; }
i bind enum shown in combobox.
<combobox itemssource="{binding path=animals }">
i have property called animalschanged of type animalsenum
when take animal the combobox, want property called animalschanged value of enum combobox.
how do xaml ? idea
thanks
use selecteditem
bind actual info item list. selectedvalue
can bind specific property selecteditem
. binds 2 way default don't need specify that:
<combobox itemssource="{binding path=animals }" selecteditem="{binding animalschanged}">
wpf binding combobox
c# - JSon Deserializing getting type -
c# - JSon Deserializing getting type -
class programme { static void main(string[] args) { string json = jsonconvert.serializeobject(new business relationship { name = "test" }, newtonsoft.json.formatting.indented, new jsonserializersettings { typenamehandling = typenamehandling.all,preservereferenceshandling = preservereferenceshandling.objects }); console.out.write(json); while (true) {} } } class business relationship { public string name; }
hey, im trying json. want deserialize object. want type info out of string. when deserialize want json recognize type without specifying it. possible?
best regards, brian
json.net unfortunately can't infer type json, if operate on json objects dynamically, check out jtoken, jobject, , jarray types newtonsoft.json.linq namespace. can read json path so
var myobject = jobject.parse(jsonstring) var someobject = myobject["myotherobject"]["otherthing"]; var mystring = (string) someobject["thestring"];
i find part of json.net useful , hope helps :)
c# .net json
Methods to pass custom object from one page to another in asp.net webform -
Methods to pass custom object from one page to another in asp.net webform -
i want pass custom object 1 page in c# asp.net> far knwo next availabel methods:
a public property in previouspage (if navigation happened through server.transfer) session cookie as form controls (if page doesn't have master page.) querystring (not suitable custom objects)is there alternate method? can't utilize of these due various reasons.
thanks
as far passing custom object 1 alternative using jquery phone call web service onclick event of link on page , $(document).ready function (or page load method) on page b , passing json serialized object out , back.
for work, however, still have way of identifying user on page b can right object user saved page a. if can utilize session, cookie or querystring pass guid or other unique identifier, you're set. if not, think you've ruled out options, , you'll need give more details how authenticating user, needed security site , page page.
asp.net
javascript - Jquery delay between two fade toggle effects -
javascript - Jquery delay between two fade toggle effects -
i showing , displaying 2 divs using jquery
the code
var show_hide = function () { $("#extravagents_label").fadetoggle(function () { $("#liquid.liquidcontanier").fadetoggle().delay(1500); }); } setinterval(show_hide, 1500);
but there problem. not doing job properly. should display other div when 1 hidden. kindly visit 203.81.193.2/jsvt/. there icons , text under main slider displaying , hiding.
you should careful timings , setinterval
can mess things pretty bad.
if timings problem:
var show_hide = function () { $("#extravagents_label").fadetoggle(callblack); } var callblack = function () { $("#liquid.liquidcontanier").fadetoggle() .delay(1500).queue(show_hide); }
hope helps, still not sure you're after
javascript jquery html toggle
Automated regression procedure in Stata -
Automated regression procedure in Stata -
i'm going study relationship between illiquidity , returns in stock markets, using amihud model proposed in paper "illiquidity , stock returns: cross-section , time-series effects" (2002). know if possible automate regression analysis. i've have more 2000 stocks in sample , i'd avoid run each regression one-by-one, speeding process up. know if possible automate process in stata? or if possible using other statistical software (r, sas, matlab, gretl,...) ? if is, how that?
you should @ foreach
, forval
ways of looping.
forval = 1/3 { regress ystock`i' xstock`i' }
would illustration if , if there variables names indicated. if have other names, or different info structure, loop still possible.
stata linear-regression
php - Compare table rows, big data amount -
php - Compare table rows, big data amount -
i have quite interesting task. don't know how phone call in 1 word in order search related topics. topic title might not reflect need. so, if has improve title - welcome.
i'll seek explain problem.
i have 100,000 rows in mysql db table. , need "compare" entries table.
"compare" doesn't mean equal. there algorithm calculation comparing level. have weight coefficient each table column. means if entry#1's column1 equals entry#2's column2 give, say, 5 point pair. , on each column.
the straight forwards way - apply calculation rules each couple of entries. why afraid of this? 100,000 entries means 5 billion "compare" operations. sure, can calculate on demand , store result somewhere in cache. believe obvious way not effective.
so, first question is: is there other improve way achive goal except of brute force?
my sec question related tool improve calculations.
application language php. hence, need load memory whole table , iterate on data. create stored procedure in mysql. using mongodb's aggregation framework or mapreduce.the to the lowest degree of first way. of - last.
i'm looking suggestion or advice people have experience in such sort of cases.
since, don't know how inquire google help, links appreciated.
update:
calculation rules bit more complicated described...
table has set of related columns used @ 1 time group(not 1 one). let's assume:
table
has fields, say, tag_1
, tag_2
, .., tag_n
. row_1
, row_2
- entries in table
.
the rule(pseudo-code):
if(row_1.tag_1==row_2.tag_1) { // gives 10 points } elseif(row_1.tag_1 in row_2.tags && row_1.tag_1!=row_2.tag_1) { // gives 5 points } .... // , on
basically, need check find intersection of 2 arrays. if not empty - points given. if indexes of tags in 2 rows match additional points given.
i'm wondering, how can accomplished using stored procedures language? because can done pretty easy using programming language.
if stored procedure can choice.
if have static table, doesn't create difference choose, long store results somewhere (presumably in database).
if info changing, need compare each new row rows, full-table scan. best done in database.
if info fits memory (and 500,000 rows should fit memory), (2) faster (3) on equivalent hardware. "equivalent hardware" of import consideration.
in cases, opt (2). sounds query like:
select t.id, t2.id, ((case when t1.col1 = t2.col1 5 else 0 end) + (case when t2.col2 = t2.col2 7 else 0 end) + . . . ) t cross bring together t2
if much more comfortable map-reduce, might find easier code there. know both languages , prefer sql this.
php mysql mongodb mapreduce aggregation
optimization - Improving performance on an Oracle view -
optimization - Improving performance on an Oracle view -
i have query save view:
with subquery ( select aaa_id, ... table_aaa ... ) select subquery.aaa_id, ... table_bbb bring together subquery using ( ... ) ;
[note: in real-life, query much more complicated this, several with
sub-queries, many performing joins
, beingness join
ed together. i'm looking general guidance can utilize work problem.]
the execution query include total table scans. makes sense since there no criteria included in where
clause. however, can eliminate of total table scans including such clause:
with subquery ( select aaa_id, ... table_aaa ... aaa_id = :id) select subquery.aaa_id, ... table_bbb bring together subquery using ( ... ) ;
however, doesn't seem have alternative of putting where
status in right place when create view:
create or replace view vw_my_view subquery ( select aaa_id, ... table_aaa ... ) select subquery.aaa_id, ... table_bbb bring together subquery using ( ... ) ; select ... vw_my_view aaa_id = :id ;
in case, execute plan still contains total table scans. there way me hint where
clause can inserted with
sub-query?
i've had similar experiences , while have no general solution, suggest following:
run "select * v$parameter2;" , create sure _complex_view_merging on. there nasty bug in 1 of 10g releases related dbas turned off , might have forgotten turn on 1 time fixed.
leave consideration hints lastly measure. in experience, they're useful preventing total table scans because optimizer doing can avoid them.
if have base of operations table primary key you're going filtering view on, seek set things view's main query starts , joins complicated clause queries, even if bring together redundant (i.e. give oracle chance easy filtering on base of operations table before joining complicated bits). create sure columns view going filtered on selected straight base of operations table , not complicated_query. like
.
(complicated_query) select base_table.key1, complicated_query.* base_table bring together complicated_query on base_table.key1 = complicated_query.key1;
if have filters utilize uncorrelated subquery, seek switching them correlated equivalent (and vice versa).
play around order of bring together statements and/or table start out in clause, if logically not create difference outcome. bit of desperate gambit, i've had execution plans alter improve doing this. optimizing oracle queries not rational process.
optimization view oracle10g query-optimization
ios - UIScrollView scroll down -
ios - UIScrollView scroll down -
i scrolling downwards uiscrollview using method:
cgpoint bottomoffset = cgpointmake(0, self.scrollforcomments.contentsize.height - self.scrollforcomments.bounds.size.height); [self.scrollforcomments setcontentoffset:bottomoffset animated:yes];
the point if content in uisecollview more actual size of scroll view works fine, otherwise if have less content method hides in scroll view. how can stop this?
why scroll if it's short scroll? instead, check see if content size taller scroll view size:
if (self.scrollforcomments.contentsize.height > self.scrollforcomments.bounds.size.height) { // if is, run code cgpoint bottomoffset = cgpointmake(0, self.scrollforcomments.contentsize.height - self.scrollforcomments.bounds.size.height); [self.scrollforcomments setcontentoffset:bottomoffset animated:yes]; } else { // if not, either nil or scroll top }
ios xcode uiscrollview
Objective-C: multiple if and return statements with least amount of code -
Objective-C: multiple if and return statements with least amount of code -
this question on how code efficiently little code possible. works need incoporate paramenter numberofshapes
. if 1 returns ■, if 2 ■■, if 3 ■■■ etc...
i if statemets , homecoming statements. if square->if number = 1> homecoming ■, if number >2 homecoming ■■ etc.. whole lot of code simple.
what best way of coding to the lowest degree amount of code?
- (nsstring *)getshape: (nsnumber *)shape numberofshapes: (nsnumber *)number { if ([shape isequaltonumber:[nsnumber numberwithint:square]]) homecoming @"■"; if ([shape isequaltonumber:[nsnumber numberwithint:circle]]) homecoming @"●"; if ([shape isequaltonumber:[nsnumber numberwithint:triangle]]) homecoming @"▲"; homecoming @"?"; }
- (nsstring *)getshape: (nsnumber *)shape numberofshapes: (nsnumber *)number { unsigned shapeint = [shape unsignedintvalue]; if (shapeint >= 3) homecoming @"?"; nsstring *shapestr = [@"■●▲" substringwithrange:nsmakerange(shapeint, 1)]; // add together autorelease here, if using mrr... nsmutablestring *result = [[nsmutablestring alloc] init]; unsigned numberint = [number unsignedintvalue]; (unsigned = 0; < numberint; i++) [result appendstring:shapestr]; homecoming result; }
i don't see point of using nsnumber
objects pass parameters this, can't simple nsuinteger
or unsigned
can, , more expensive use.
objective-c
javascript - HTML5 How to make canvas not stretch page? -
javascript - HTML5 How to make canvas not stretch page? -
i have learned how work canvases in html5, , have question.
is there way create canvas not stretch other elements on page? illustration have text, if set canvas of 500px wide, text sent right create space canvas, there way set canvas under text or create not stretch other elements in page, or there technique used appropriately position canvases in way want exactly?
thanks help.
just treat canvas treat div. way size/position div, can same canvas. if having specific problem adjusting canvas, post code using.
edit : also, careful if setting canvas height/width css changes element size, not drawing surface size. create sure both element , drawing surface size changes, utilize width , height attribute.
javascript html5 css3 canvas stretch
linux - Perl program for sorting an array not working -
linux - Perl program for sorting an array not working -
i new perl programming.... wrote simple script sorting of numbers in array script not working expected. please help me this.
#!/usr/bin/perl print ("enter numbers...... please come in blank space @ end\n"); $input = <stdin>; chop ($input); $a = 1; until ( $input == "" ) { @array[$a-1] = $input ; $a++; $input = <stdin>; chop ($input); } print ("@array\n"); $count = 1; $y = 1; while ( $count < @array ) { if ( $array[$y-1] > $array[$y] ) { @array[$y-1,$y] = @array[$y,$y-1]; $y++; } $count++; } print ("@array\n");
i get:
enter numbers...... please come in blank space @ end 2 4 3 2 4 3 2 4 3
http://codepad.org/ltvxt8zg
#!/usr/bin/perl utilize strict; utilize warnings; $"=','; @input; while(<data>) { s/\s+$//; force @input, $_; } print "original input: @input\n"; @input = sort { $a <=> $b } @input; print "sorted input: @input\n"; __end__ 3 1 2
linux perl
c++ - about spin lock -
c++ - about spin lock -
i have questions in boost spinlock code :
class spinlock { public: spinlock() : v_(0) { } bool try_lock() { long r = interlockedexchange(&v_, 1); _readwritebarrier(); // 1. mean homecoming r == 0; } void lock() { (unsigned k = 0; !try_lock(); ++k) { yield(k); } } void unlock() { _readwritebarrier(); *const_cast<long volatile*>(&v_) = 0; // 2. why don't need utilize interlockedexchange(&v_, 0); } private: long v_; };
a readwritebarrier() "memory barrier" (in case both reads , writes), special instruction processor ensure instructions resulting in memory operations have completed (load
& store
operations - or in illustration x86 processors, opertion has memory operand @ either side). in particular case, create sure interlockedexchange(&v_,1) has completed before continue.
because interlockedexchange
less efficient (takes more interaction other cores in machine ensure other processor cores have 'let go' of value - makes no sense, since (in correctly working code) unlock
if hold lock, no other processor have different value cached we're writing on anyway), , volatile
write memory good.
c++ locking
javascript - Does IE10 support FormData()? -
javascript - Does IE10 support FormData()? -
i've read (here) ie10 supports formdata(). when type ie10 javascript console:
foo = new formdata();
i error, "formdata not defined"
does ie10 back upwards formdata() or doesn't it? there trick getting work in ie10?
i can confirm - running code in console on page works fine.
i hence hypothesize in quirks mode, , hence browser pretending doesn't know compatible said mode.
make sure page has valid <!doctype html>
@ start , no errors fall quirks mode.
javascript html ajax internet-explorer internet-explorer-10
python - How do I fix this error? TypeError: 'str' does not support the buffer interface -
python - How do I fix this error? TypeError: 'str' does not support the buffer interface -
>>> import struct >>> s = '\x00\x00\x00\x01\x00\x00\x00\xff\xff\x00\x00' >>> struct.unpack('11b', s) traceback (most recent phone call last): file "<pyshell#3>", line 1, in <module> struct.unpack('11b', s) typeerror: 'str' not back upwards buffer interface
what wrong this? please help.
on python 3, struct.unpack()
expects object implements buffer protocol, such bytes
value, not unicode str
:
>>> import struct >>> s = b'\x00\x00\x00\x01\x00\x00\x00\xff\xff\x00\x00' >>> struct.unpack('11b', s) (0, 0, 0, 1, 0, 0, 0, 255, 255, 0, 0)
if reading info file, open file in binary mode instead of text mode bytes.
python string runtime-error
c++ - Shared library on Android: String assignments (=) to struct values cause segfault (dlfree) -
c++ - Shared library on Android: String assignments (=) to struct values cause segfault (dlfree) -
i developing shared library in c++ android devices.
while writing tests stumbled on unusual behaviour causes segfault (dlfree), when calling function in illustration code.
first of all:
the test calls library function links dynamically against library. i compiled library , test linux , windows desktops. there run without causing segfault. linking statically, segfault not appear on android.example code
typedef unsigned int dbruleid; typedef std::string dbruletarget; struct dbrule { dbruleid id; //int dbruletarget target; //std::string }; //segfault variant bool getrule(dbruleid id, dbrule& rule) { rule.target = "i causing segfault!"; homecoming true; } //working variant bool getrule(dbruleid id, dbrule& rule) { //nothing set homecoming true; }
segmentation fault
build fingerprint: 'generic/sdk/generic:3.0/honeycomb/104254:eng/test-keys' pid: 525, tid: 525 >>> /data/local/testrulesdb <<< signal 11 (sigsegv), code 1 (segv_maperr), fault addr deadbaad r0 deadbaad r1 0000000c r2 00000027 r3 00000000 r4 00000080 r5 aff46658 r6 00013000 r7 00000004 r8 00000004 r9 00013d3c 10 00000000 fp bec61a14 ip ffffffff sp bec61950 lr aff193e9 pc aff15f58 cpsr 00000030 #00 pc 00015f58 /system/lib/libc.so #01 pc 00012d2a /system/lib/libc.so (dlfree)
edit - new findings
if dbrule struct, passed function, initialized values works fine, otherwise results in segmentation fault.
//works dbrule rule_1 = { 0, "target"}; //works not dbrule rule_1 = { 0, ""}; //works not dbrule rule_1;
could please explain me? , best way initialize default?
the questions are
what doing wrong, missing? is there mechanism tries delete allocated memory on heap more once?i fired valgrind on desktop already, there no errors shown.
thanks in advance!
your issue empty std::string objects utilize same location internal storage: internal storage of empty std::string same static member. , stl uses location determine whether or not should deallocate std::string's internal storage.
this works statically compiled code, or when not passing empty strings across dynamic library boundaries; when dealing dynamic libraries, issues start crop up: both executable , each dynamic library have different storage locations empty std::string.
so here going on: when code executes:
rule.target = "i causing segfault!";
the first thing happens internal storage of rule.target deallocated. if rule.target empty std::string (regardless of how got way), point global empty std::string storage of code initialized. if did not happen within library, library conclude not empty string , seek deallocate storage. since statically allocated client code, segfault.
one way prepare link library statically (as discovered); utilize shared version of c++ runtime (and require clients same) exports internal symbol empty std::string. final solution avoid using std::string on library's interface, straight or indirectly, if there chance receive or send empty std::string.
android c++ string
jquery - How to display nth divs within a certain div using javascript? -
jquery - How to display nth divs within a certain div using javascript? -
i have multiple divs on page , in div there more kid divs floated go across page. want able utilize javascript see width of window , split set width of divs work out how many display.
i have found 2 pieces of code. 1 measures window width , other piece divs , hide rest.
$('div').slice(4).hide(); var width = $(window).width(); $(window).resize(function(){ if($(this).width() != width){ width = $(this).width(); console.log(width); alert(width); } });
my problem how select divs within speciedfied div. have tried hasn't worked. don't know if i'm goin in right direction
$("#maincontent2").append(('div').slice(4).hide());
is javascrpt right way go or css able i'm after?
many thanks
edit: html
<div id='maincontent> <p></p> <div> <div id='maincontent2'> <div><img></img><p></p></div> <div><img></img><p></p></div> <div><img></img><p></p></div> <div><img></img><p></p></div> <div><img></img><p></p></div> </div>
if have got number of div show in particular div can utilize code.
$(#mainconetent2 > div).slice(4).hide());
javascript jquery html
JQuery UI Multiple Dialogs Not Working -
JQuery UI Multiple Dialogs Not Working -
i have page 2 links open 2 different modals, "forgotten password" link opens "forgotten password" modal , "tell-a-friend" link opens "tell-a-friend" modal.
both modals contain forms can submitted.
the problem if open first modal , submit or close it, cannot submit sec modal. can open sec modal, cannot submit it.
please advise problem be!
here below javascript code resides in separate javascript file, imported html file. not inline javascript, if matter.
[code]
var forgottenpassworddiv; var tellafrienddiv; function clearerrormessages() { $('#errormessage').text(""); } function openforgottenpassword() { forgottenpassworddiv = $('#forgotten-password'); $('#forgotten-password').load("/templates/include/new/ajax/modal/forgottenpassword.jsp") .dialog( { autoopen:false, modal:true, position:'left+35% top+20%', width:'330', height:'auto' } ); $('#forgotten-password').dialog('open'); } function closeforgottenpassword() { forgottenpassworddiv.dialog("close"); } function submitforgottenpassword() { clearerrormessages(); var email = $('#email').val(); if (email == null || email == '') { $('#errormessage').text("please come in user name or email"); } else { clearerrormessages(); /* ajax post */ var formdata = $("#forgottenpasswordform").serialize(); $.ajax({ type: "get", url: "/templates/include/new/ajax/forgottenpassword.jsp", data: formdata, success: function(data) { if (data.error != null) { $("#errormessage").text(data.error); } else { $('#forgottenpasswordform , .info').fadeout(1000); $("#successmessage").text(data.success); $("div").removeclass('display-none'); } }, datatype: 'json' }); } } function opentellafriend(gunid) { tellafrienddiv = $('#tell-a-friend'); $('#tell-a-friend').load("/templates/include/new/ajax/modal/tellafriend.jsp?id=" + gunid) .dialog( { autoopen:false, modal:true, position:'center top+10%', width:'330', height:'auto' } ); $('#tell-a-friend').dialog('open'); } function closetellafriend() { tellafrienddiv.dialog("close"); } function submittellafriend() { clearerrormessages(); var yourname = $('#yourname').val(); var errormessage = ""; if (yourname == null || yourname == '') { errormessage += "please come in name<br />"; } if (errormessage != '') { $('#errormessage').html(errormessage); } else { clearerrormessages(); /* ajax post */ var formdata = $("#tellafriendform").serialize(); $.ajax({ type: "get", url: "/templates/include/new/ajax/tellafriend.jsp", data: formdata, success: function(data) { if (data.error != null) { $("#errormessage").text(data.error); } else { $("#tellafriendform").fadeout(1000); $("#successmessage").text(data.success); $("div").removeclass('display-none'); } }, datatype: 'json' }); } }
[/code]
the ui-dialog widget remain in dom hidden element after dialog closed. so, in order isolate 2 dialog functionalities each other i'd suggest call:
forgottenpassworddiv.dialog("destroy")
in "closeforgottenpassword" function and
tellafrienddiv.dialog("destroy")
in "closetellafriend" function.
this homecoming dialog pre-init state (which not harmful @ because reinit in "open" functions.)
jquery-ui jquery
c# - How often is WindowsServiceBase.Tick() called in an EWL Windows Service? -
c# - How often is WindowsServiceBase.Tick() called in an EWL Windows Service? -
i have determined have intense operations shouldn't occur in context of web request in ewl web application. see ewl supports running windows service perfect running intense operations in background without tying web request threads , forcing users wait.
i point need implement void windowsservicebase.tick()
don't see how tick()
called. how tick()
called default , configurable?
i see source windows service sends "health check" email before calling tick()
. what's thinking behind this? if don't want email spammed these emails?
the code in servicebaseadapter
cryptic, looking can see tick
called 10 seconds after init
completes and, on, 10 seconds after lastly tick
phone call completes.
the health check email go out shortly after midnight every day. it's designed allow know service still alive.
c# asp.net windows-services background-process enterprise-web-library
Storing huge dictionary IOS -
Storing huge dictionary IOS -
my app has it's own sql database let's 2000 rows. know in future add together new , delete old. each row got prioritet parameter changes in order of user interaction. want store prioritets locally future app updates not erase them.
so question best way of doing that? remember need fast access prioritets in future , must mutable.
ios dictionary storage updates
php - I can't fetch temp table data from store procudere -
php - I can't fetch temp table data from store procudere -
i created on store procedure in sql server below structure
alter procedure [dbo].[list_final_player_report] -- add together parameters stored procedure here @teamid int begin create table #temptable ( playername varchar(50), rank_in_speedladdar int, rank_in_120s int, rank_in_cone int, rank_in_beep int, rank_in_cooper int, rank_in_pushups int, rank_in_situp int, rank_in_pullup int, rank_in_40s int, rank_in_pushopbattle int, rank_in_vertical_jump int, rank_in_shuttle int ) declare @playerid int declare @firstname nvarchar(10) -- define cursor declare cursor1 cursor select players.playerid playerid , players.firstname players teamid=@teamid -- should open cursor open cursor1 -- need fetch rows @empid variable fetch cursor1 @playerid,@firstname --looping while(@@fetch_status=0) begin insert #temptable values(@firstname, (select (sum(total))/count(playerid) challengestats challengestats.challengeid =1 , challengestats.playerid=@playerid ), (select (sum(total))/count(playerid) challengestats challengestats.challengeid =2 , challengestats.playerid=@playerid ), (select (sum(total))/count(playerid) challengestats challengestats.challengeid =3 , challengestats.playerid=@playerid ) , (select (sum(total))/count(playerid) challengestats challengestats.challengeid =4 , challengestats.playerid=@playerid ) , (select (sum(total))/count(playerid) challengestats challengestats.challengeid =5 , challengestats.playerid=@playerid ) , (select (sum(total))/count(playerid) challengestats challengestats.challengeid =6 , challengestats.playerid=@playerid ) , (select (sum(total))/count(playerid) challengestats challengestats.challengeid =7 , challengestats.playerid=@playerid ) , (select (sum(total))/count(playerid) challengestats challengestats.challengeid =8 , challengestats.playerid=@playerid ) , (select (sum(total))/count(playerid) challengestats challengestats.challengeid =9 , challengestats.playerid=@playerid ) , (select (sum(total))/count(playerid) challengestats challengestats.challengeid =10 , challengestats.playerid=@playerid ) , (select (sum(total))/count(playerid) challengestats challengestats.challengeid =11 , challengestats.playerid=@playerid ) , (select (sum(total))/count(playerid) challengestats challengestats.challengeid =12 , challengestats.playerid=@playerid ) ) fetch cursor1 @playerid,@firstname end close cursor1 deallocate cursor1 select * #temptable end
this sp execute in sqlserver
but problem how temp table info php resultset
instead of using temp table, why not utilize table variable. should not have alter much code in order implemented.
declare @temptable table ( playername varchar(50), rank_in_speedladdar int, rank_in_120s int, rank_in_cone int, rank_in_beep int, rank_in_cooper int, rank_in_pushups int, rank_in_situp int, rank_in_pullup int, rank_in_40s int, rank_in_pushopbattle int, rank_in_vertical_jump int, rank_in_shuttle int )
temp tables during scope of used, causing issue. seek above, , should different result.
php sql-server
c++: writing strings to file by removing first char -
c++: writing strings to file by removing first char -
i reading input file line line using ifstream , getline (say in string line
). , have output string line
file removing first character of it. doing erase
ing first character of line , outputting using ofstream. there improve method (means relatively faster one) ? have millions of strings. (note not true lines, first line of every 10 line).
you output actual string pointer plus one:
outputstream << (line.c_str() + 1);
however, should improve check string not empty first, or might end accessing illegal pointer.
if want output substring there's std::string::substr
function. or utilize std::ostream::write
function combined pointer arithmetic outlined above:
outputstream.write(line.c_str() + 1, 9); /* 1st 10th character */
for above, have create sure length of string @ to the lowest degree 10 characters.
note: not utilize "hacks" ones outlined in answer, unless in extreme situations. substring function there reason, , 1 recommend using.
c++
java - Understanding how to use my Android JSON Parser -
java - Understanding how to use my Android JSON Parser -
hello, i'm having hard time understanding how want json parser. i'm parsing info located @ http://api.pathofexile.com/leagues?type=all pull out league ids (currently "default", "hardcore", "feb 12 solo hc race", etc.) parser puts these ids listview.
the problem i'm having these ids alter on time. have own json urls need parse based on league id. example, if league id "default" need take id , set url:
"api.pathofexile.com/leagues/"+ id +"?ladder=1&ladderoffset=1&ladderlimit=2" http://api.pathofexile.com/leagues/default?ladder=1&ladderoffset=1&ladderlimit=2
basically, want able click id in listview , have update url , parse new info separate list.
here have json parser:
class="lang-java prettyprint-override">public class leagues extends listactivity { public static string url = "http://api.pathofexile.com/leagues?type=all"; private static final string tag_id = "id"; static inputstream = null; static jsonobject jobj = null; static string json = ""; jsonarray leagues = null; public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); //setcontentview(r.layout.list_item); new getjsontask().execute(""); } protected class getjsontask extends asynctask<string, integer, arraylist<hashmap<string, string>>> { protected arraylist<hashmap<string, string>> leagueslist; private final progressdialog dialog = new progressdialog(leagues.this); // onpreexecute method protected void onpreexecute() { this.dialog.setmessage("loading, please wait.."); this.dialog.setcancelable(false); this.dialog.show(); } // doinbackground method @override protected arraylist<hashmap<string, string>> doinbackground(string... params) { leagueslist = new arraylist<hashmap<string, string>>(); // defaulthttpclient seek { defaulthttpclient httpclient = new defaulthttpclient(); httpget httpget = new httpget(url); httpresponse httpresponse = httpclient.execute(httpget); json = entityutils.tostring(httpresponse.getentity()); // getting array of entries jsonarray leagues = new jsonarray(json); // looping through entries (int = 0; < leagues.length(); i++) { jsonobject league = leagues.getjsonobject(i); string id = league.getstring(tag_id); // creating new hashmap hashmap<string, string> map = new hashmap<string, string>(); // adding each kid node hashmap key => value map.put(tag_id, id); //map.put(tag_event, event); // adding hashlist arraylist leagueslist.add(map); } } grab (jsonexception e) { e.printstacktrace(); } grab (clientprotocolexception e) { // todo auto-generated grab block e.printstacktrace(); } grab (ioexception e) { // todo auto-generated grab block e.printstacktrace(); } homecoming leagueslist; } // onpostexecute method protected void onpostexecute(arraylist<hashmap<string, string>> result) { listadapter adapter = new simpleadapter(getapplicationcontext(), leagueslist, r.layout.league, new string[] { tag_id }, new int[] { r.id.id }); // selecting single listview item listview lv = getlistview(); lv.setadapter(adapter); if (this.dialog.isshowing()) { this.dialog.dismiss(); } } } }
i'm pretty lost @ point. i'm trying possible how have parser set now? can point me in right direction?
thanks.
edit farther clarification:
right parser set league ids listview url "api.pathofexile.com/leagues?type=all" below:
default hardcore feb 12 solo hc race(these items alter on time)
i want able click on "default," alter url "api.pathofexile.com/leagues/default?ladder=1&ladderoffset=1&ladderlimit=2" , parse new listview.
update: using project provided darwind, changed around (using of other code) show json info wanted after clicking on league id.
class="lang-java prettyprint-override">public class leagueview extends listactivity { //private textview leagueid, leaguedescription; private static final string tag_ladder = "ladder"; private static final string tag_entries = "entries"; private static final string tag_online = "online"; private static final string tag_rank = "rank"; private static final string tag_character = "character"; private static final string tag_charname = "name"; private static final string tag_level = "level"; private static final string tag_class = "class"; private static final string tag_experience = "experience"; private static final string tag_account = "account"; private static final string tag_accname = "name"; private static final string tag_accname2 = "name2"; @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); //setcontentview(r.layout.league_layout); //leagueid = (textview) findviewbyid(r.id.leagueid); //leaguedescription = (textview) findviewbyid(r.id.leaguedescription); string urltojson = getintent().getextras().getstring("leagueurl"); if (urltojson == null) { toast.maketext(this, "url null!", toast.length_long).show(); } else { new leaguetask().execute(urltojson.replaceall(" ", "%20")); } } protected class leaguetask extends asynctask<string, integer, league> { private final progressdialog dialog = new progressdialog(leagueview.this); protected arraylist<hashmap<string, string>> entrieslist; // onpreexecute method protected void onpreexecute() { this.dialog.setmessage("retrieving ladder information..."); this.dialog.setcancelable(false); this.dialog.show(); } // doinbackground method @override protected league doinbackground(string... params) { league aleague = new league(); entrieslist = new arraylist<hashmap<string, string>>(); // defaulthttpclient seek { defaulthttpclient httpclient = new defaulthttpclient(); httpget httpget = new httpget(params[0]); httpresponse httpresponse = httpclient.execute(httpget); string json = entityutils.tostring(httpresponse.getentity()); // getting jsonobject filled. jsonobject leagueobject = new jsonobject(json); //string id = leagueobject.getstring("id"); //string description = leagueobject.getstring("description"); jsonobject ladder = leagueobject.getjsonobject(tag_ladder); jsonarray entries = ladder.getjsonarray(tag_entries); // looping through entries (int = 0; < entries.length(); i++) { jsonobject ent = entries.getjsonobject(i); // storing each json item in variable string online = ent.getstring(tag_online); if (online == "false") online = "offline"; else online = "online"; string rank = ent.getstring(tag_rank); // pull out character object jsonobject character = ent.getjsonobject(tag_character); string chname = character.getstring(tag_charname); string lvl = character.getstring(tag_level); string cl = character.getstring(tag_class); string xp = character.getstring(tag_experience); // pull out business relationship object jsonobject business relationship = ent.getjsonobject(tag_account); string accname = account.getstring(tag_accname); // creating new hashmap hashmap<string, string> map = new hashmap<string, string>(); // adding each kid node hashmap key => value map.put(tag_online, online); map.put(tag_charname, chname); map.put(tag_accname2, accname); map.put(tag_rank, rank); map.put(tag_level, lvl); map.put(tag_experience, xp); map.put(tag_class, cl); entrieslist.add(map); } // creating league display aleague = new league(); //aleague.setleagueid(id); //aleague.setdescription(description); } grab (jsonexception e) { e.printstacktrace(); } grab (clientprotocolexception e) { // todo auto-generated grab block e.printstacktrace(); } grab (ioexception e) { // todo auto-generated grab block e.printstacktrace(); } homecoming aleague; } // onpostexecute method protected void onpostexecute(league result) { //leagueid.settext(result.getleagueid()); //leaguedescription.settext(result.getdescription()); listadapter adapter = new simpleadapter(getapplicationcontext(), entrieslist, r.layout.league_layout, new string[] { tag_rank, tag_charname, tag_level, tag_experience, tag_class }, new int[] { r.id.rank, r.id.chname, r.id.lvl, r.id.experience, r.id.cl }); // selecting single listview item listview lv = getlistview(); lv.setadapter(adapter); if (this.dialog.isshowing()) { this.dialog.dismiss(); } } } }
ok so, vsnyc pointed out title bit misleading.
the way see it, this:
get list of leagues parsing json array be able click league in list , view supplying info selected league, parsing json object.i went , kanged code , changed bit. instance mentioned in comment, should utilize class represent every league , override tostring
method new kind of object, class used straight in listview
.
as first url you're using: http://api.pathofexile.com/leagues?type=all
returning json array , not single object , objects within array different info returned when selecting specific league, wouldn't recommend utilize same asynctask getting both list of leagues , single league.
instead after you've populated first listview
leagues, create sec view, populated getting info specific league.
to sec view representing 1 league, need implement onitemclicklistener
listview
of first view. in onitemclicklistener
selected leagues name , pass next view in turn contact server , json
object representing given league , parse data.
i've created little project quite lot of code add together reply , take me more time remove unnecessary code, give total working project. ;-)
here's project in zip file:
https://dl.dropbox.com/u/27724371/androidlistviews.zip
let me know if wasn't looking for.
java android json
c# - Bulk Copy of multiple Excel files to database -
c# - Bulk Copy of multiple Excel files to database -
i need read info of particular range in excel file , upload them in database.
the required info not start @ a1 cell instead, start @ a15 , a14 header row columns. there 7 columns headers.
(i tried read cells via "get_range" option)
we need read info in each cell , row row update in database.
there thousands of files of same type in specific folder.
i trying accomplish c# console app because 1 time job.
here reply found.
step 1 : loop through each file in source directory.
step 2 : add together excel interop reference. , create excel application class object, , workbook, , range(for used range).
step 3 : utilize range() function , read rows. (since solution specific problem, start , end ranges of rows , columns known)
step 4 : each read row can constructed string till end of file. or insert can done after reading each row.
step 5 : connection string , create sqlconnection object perform insert. improve utilize transaction-commit.
done. all.
c# database excel bulkinsert
javascript - JQuery youtube link to embedded doesnt work -
javascript - JQuery youtube link to embedded doesnt work -
please check: http://jsfiddle.net/t6nja/
my jquery:
$('.training').html(function(i,v){ var id = v.split('watch?v=')[1]; // id can add together iframe homecoming '<iframe width="150" height="150" src="http://www.youtube.com/embed/' + id + '" frameborder="0" allowfullscreen></iframe>'; });
}); html:
<div class="training">http://www.youtube.com/watch?v=dabphlxeyw8e</div><div class="training">http://youtu.be/dabphlxeyw8f</div>
im clueless...
i think problem video id in first div look @ example i've changed video id dabphlxeyw8e
dabphlxeyw8
javascript jquery html
excel vba - Copy data upto last used Row of a specific column -
excel vba - Copy data upto last used Row of a specific column -
i using code lastly used rows-
rowno=objexcel.activeworkbook.sheets(1).usedrange.rows.count
now, want re-create info of specific column upto lastly row used.
//what write in below code utilize rowno //
set source=objexcel.activeworkbook.sheets(1).column("g")
source.copy
that's wrong way find lastly row. see link on how find lastly row.
once have found lastly row utilize code copy
ws.range("g1:g" & rowno).copy
where ws
worksheet object.
excel-vba vbscript
javascript - Can't get connect-flash to work with express.js on redirect -
javascript - Can't get connect-flash to work with express.js on redirect -
ok reason session flash works when res.render()
, when seek set session flash , redirect, doesn't display. problem below in contact method in else
clause)...
this logged console during redirect:
{} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} { info: [ 'thanks homecoming message soon' ] } {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}
as can see, message in there, looks it's getting replaced empty object.
here code:
app.js
var flash = require('connect-flash'); // grab sessions var sessionflash = function(req, res, next) { res.locals.messages = req.flash(); console.log(res.locals.messages); next(); } app.configure(function() { app.set('views', __dirname + '/views'); app.set('view engine', 'jade'); app.use(viewhelpers()); app.use(express.bodyparser({ uploaddir : './' })); app.use(expressvalidator); app.use(express.methodoverride()); app.use(express.cookieparser('keyboard cat')); app.use(express.session({ secret: config.secret, cookie: { maxage: 365 * 24 * 60 * 60 * 1000 }, store: new mongostore(config.db) })); app.use(flash()); app.use(sessionflash); app.use(express.static(__dirname + '/public')); app.use(app.router); });
views/layout.jade
- if (typeof message !== 'undefined') =message
controllers/index.js
function controllers(params) { controllers.contact = function(req, res) { if (errors) { // works intended req.flash('info', 'please prepare errors below.'); res.render('contact', { title : 'contact -', message: req.flash('info'), errors: errors, params: params }); return; } else { // doesn't work req.flash('info', 'thanks homecoming message soon'); res.redirect('/'); } }; homecoming controllers } module.exports = controllers;
well, redirecting '/', server not respond to.
you don't have app.get('/', function(req, res){...});
in app.js
flash messages messages stored on server duration between 2 requests same client, , available in next request. flash not show because res.redirect('/');
nothing.
javascript node.js express
java - How to get Hibernate entityManager.createNamedQuery results -
java - How to get Hibernate entityManager.createNamedQuery results -
i using hibernate 4.0
i have method in dao class next method homecoming entity class employees
. calling oracle function returns sys_refcursor
. how can homecoming entitymanager.createnamedquery
in below method?
any help highly appreciated.
@override public employees getemployeerecords(string employeenumber) { <??> = entitymanager.createnamedquery("myfunction"); homecoming <??>; }
see this
query query = em.createquery("select e employee e e.name = :name "); query.setparameter("name", name); list<employee> results = query.getresultlist(); homecoming results;
here returning list of employee type , if want send 1 object this
return results.get(0);
regards
anshul
java hibernate jpa jpa-2.0
Reformatting date in google spreadsheet -
Reformatting date in google spreadsheet -
i'm setting spreadsheet else form come in data. 1 of columns supposed hold date. input date format example: "jan 26, 2013" (there lot of re-create & paste involved collect data, changing format @ input step not real option).
i need date column sortable, spreadsheet doesn't recognize date string. (it recognize "jan-26-2013", i've tried.) need reformat input date.
my question is: how can this? have looked around , google apps script looks way go (though haven't found illustration of reformatting yet). unfortunately programming experience in python, , of intermediate level. in python without problem, don't know javascript. (my python approach be:
splitted = date.split() newdate = "-".join([splitted[0], splitted[1][:-1], splitted[2]]) homecoming newdate
)
i don't know how i'd go linking script spreadsheet - attach cell, or form, or where? , how? link helpful, understandable tutorial etc. on point help greatly.
any help appreciated! lastalda
edit: here's code ended with:
//function filter unwanted " chars date entries function reformatdate() { var sheet = spreadsheetapp.getactivesheet(); var startrow = 2; var firstcolumn = 6; var columnspan = 1; var lastrow = sheet.getlastrow(); var dates = sheet.getrange(startrow, firstcolumn, lastrow, columnspan).getvalues(); newdates = [] for(var in dates){ var mydate = dates[i][0]; seek { var newdate = mydate.replace(/"/g,''); } catch(err) { var newdate = mydate } newdates.push([newdate]); } sheet.getrange(startrow, firstcolumn, lastrow, columnspan).setvalues(newdates) }
for other confused google-script newbies me:
attaching script spreadsheet works creating script within spreadsheet (tools => script editor). putting function in there enough, don't seem need function phone call etc.
you select trigger of script script editor (resources => project's triggers).
important: script work if there's empty row @ bottom of sheet in question!
just thought :
if double click on date string in spreadsheet see real value makes string instead of date object 'jan 26, 2013
'
in front end of string didn't add together here...(the form allow type want in text area, including +322475... illustration if phone number, that's known trick in spreadsheets cells) create script runs on form submit , removes '
in cells, guess spreadsheet rest... (i didn't test give seek , consider suggestion).
to remove '
can utilize .replace()
method **
var newvalue = value.replace(/'/g,'');
here links relevant documentation : link1 link2
edit next comment :
it simpler since replace
doesn't generate error if no match found. create :
function reformatdate() { var sheet = spreadsheetapp.getactivesheet(); var dates = sheet.getrange(2, 6, sheet.getlastrow(), 1).getvalues(); newdates = [] for(var in dates){ var mydate = dates[i][0]; var newdate = mydate.replace(/"/g,''); newdates.push([newdate]); } sheet.getrange(2, 6, sheet.getlastrow(), 1).setvalues(newdates) }
also, used "
in code, presumably on purpose... test showed '
instead. made create selection ?
google-apps-script spreadsheet
iOS - Isometric grid image problems -
iOS - Isometric grid image problems -
i have myriad of uiimageviews
deed 'tiles' on map. align next 1 form grid of images. layer
of each uiimageview
added sublayer of uiview
.
ordinarily, grid images flush against each other, whenever uiscrollview
contains uiview
zoomed in or out, spaces between tile images become visible, showing off grid pattern i'd invisible.
any ideas might causing this?
sounds you're trying create catiledlayer scratch...?
why not utilize catiledlayer?
ios grid isometric
parallel processing - Huge slow down using openmp -
parallel processing - Huge slow down using openmp -
i trying test speed little piece of code follows:
for(i=0;i<imgdim;i++) { x[0][i] = z[i] - u1[i] * rhoinv; x[1][i] = z[i] - u2[i] * rhoinv; x[2][i] = z[i] - u3[i] * rhoinv; }
the iteration around 200 , imgdim 1000000. total time piece of code around 2 seconds. , whole code cost 15 seconds. after utilize openmp parallel piece of code like:
omp_set_num_threads(max_threads); #pragma omp parallel shared(x,z,u1,u2,u3,imgdim,rhoinv) private(i) { #pragma omp schedule(dynamic) for(i=0;i<imgdim;i++) { x[0][i] = z[i] - u1[i] * rhoinv; x[1][i] = z[i] - u2[i] * rhoinv; x[2][i] = z[i] - u3[i] * rhoinv; } }
max_threads 8. little piece of code needs around 11 seconds , entire code utilize around 27 seconds. unusual thing time decreases 6 seconds if alter max_threads 1. still much longer sequential code.
it costs me lot of time , can not find problem. appreciate if can help me that.
schedule(dynamic)
introduces huge run-time overhead. should used loops each iteration take different amount of time , improved load balancing justify overhead. regular loops yours dynamic scheduling overkill introduces unnecessary overhead, slows downwards computation.
change schedule type static
:
#pragma omp parallel schedule(static) for(i=0;i<imgdim;i++) { x[0][i] = z[i] - u1[i] * rhoinv; x[1][i] = z[i] - u2[i] * rhoinv; x[2][i] = z[i] - u3[i] * rhoinv; }
(note: variables declared in outer scopes shared default , parallel loop command variable implicitly private)
parallel-processing openmp
php - how to logout from all views in codeigniter , am i using wrong code? -
php - how to logout from all views in codeigniter , am i using wrong code? -
hey guys help me logout pages of view..when click on logout link 1 page when trying logout page not work . . cpntoller code is:-
function index() { if($this->session->userdata('logged_in')) { $session_data = $this->session->userdata('logged_in'); $data['email'] = $session_data['email']; $this->load->view('home_view', $data); $this->load->view('home_content_view', $data); } else { //if no session, redirect login page redirect('login', 'refresh'); } } function logout() { $this->session->unset_userdata('logged_in'); session_destroy(); redirect('home', 'refresh'); }
first of codeigniter doesnot utilize php native session session_destroy won't work utilize $this->session->sess_destroy()
instead. in constructor of each controller (if have multiple controllers). check user session if not exist redirect user page want display.
class home extends ci_controller { function __construct() { parent::__construct(); //this status checks existence of session if user not accessing //login method can accessed without user session if( !$this->session->userdata('logged_in') && $this->router->method != 'login' ) { redirect('login'); } } function index() { $session_data = $this->session->userdata('logged_in'); $data['email'] = $session_data['email']; $this->load->view('home_view', $data); $this->load->view('home_content_view', $data); } function logout() { $this->session->userdata = array(); $this->session->sess_destroy(); redirect('home', 'refresh'); } }
php mysql codeigniter
internet explorer 7 - Open a file (not download) within IE7, filename is unicode-encoded -
internet explorer 7 - Open a file (not download) within IE7, filename is unicode-encoded -
i'm using java application that's encoded in utf-8. when download file in application, filename normal (filename: 일자별_주문_내역.xls). when open file ie7, filename in unicode (filename: %ec%90%bc%ec%9e....). when opening file within ie8, filename normal.
filename = urlencoder.encode(filename, "utf-8"); if(useragent.indexof("safari") > -1){ filename = "filename=" + filename + ".xls"; } else if(useragent.indexof("msie") > -1){ filename = "filename=" + filename + ".xls"; } else{ filename = "filename*=utf-8\'\'" + filename + ".xls"; } response.setheader("content-disposition", "attachment;" + filename); response.setcontenttype("application/vnd.ms-excel; charset=utf-8"); response.setheader("content-descriptioin", "excel download");
unicode internet-explorer-7 filenames
javascript - Show international phone format for international visitors only -
javascript - Show international phone format for international visitors only -
i wondering if there's javascript can utilize when international visitor (non-us) visits site, they'll see international phone format can follow. changing "value" international phone format example.
this code input field have...
<input id="phone" class="numphone" maxlength="255" name="phone_number" type="text" tabindex="6" value="(555) 123-4567" onblur="if (this.value == '') {this.value = '(555) 123-4567';}" onfocus="if (this.value == '(555) 123-4567') {this.value = '';}" />
thanks!
there no way observe programmatically whether visitor “international” or “non-us”, meaningful definition of such concepts. using geolocation , other tools, might able decide, perhaps acceptable margin of error, whether user’s device located in territory or not. won’t tell whether user european or asian businessman visiting us, example, or citizen using computer outside us.
moreover, seems input format, should inquire users come in phone number in international format perhaps imply if country prefix missing (or prompt corrected information). , should parse phone number “(”, “)”, “-”, , space ignored, because carry no relevant info typed people familiar such notations.
javascript jquery html
How to build java project with command-line arguments in IntelliJ -
How to build java project with command-line arguments in IntelliJ -
i have java test project has 2 binary fields.when want compile project in intellij,it complains should utilize -source 7 instead of -source 1.6 while compiling.my jdk latest.i don't know how prepare this.
sample code:
public class bitwisetest { static int val1 = 0b01110;//compile-time error static int val2 = 0b11011;//compile-time error public static void main() { system.out.println(val1 & val2); } }
the issue happens due wrong configuration of project language level set. although may using java 7 since project language level configured incorrectly uses constructs valid in language level.thus error. prepare follow steps :
go file->project structure->project & alter project language level 7.0 & project sdk 1.7
java build compilation intellij-idea javac
mysql - Can't start server: Bind on TCP/IP port: Cannot assign requested address -
mysql - Can't start server: Bind on TCP/IP port: Cannot assign requested address -
i rebooted server yesterday, unfortunately mysql cannot started now.
the error log following:
root@site-digger:/var/log/mysql# cat error.log 130216 16:11:32 [note] plugin 'federated' disabled. 130216 16:11:32 innodb: initializing buffer pool, size = 8.0m 130216 16:11:32 innodb: completed initialization of buffer pool 130216 16:11:33 innodb: started; log sequence number 0 1382359817 130216 16:11:33 [error] can't start server: bind on tcp/ip port: cannot assign requested address 130216 16:11:33 [error] have mysqld server running on port: 3306 ? 130216 16:11:33 [error] aborting 130216 16:11:33 innodb: starting shutdown... 130216 16:11:38 innodb: shutdown completed; log sequence number 0 1382359817 130216 16:11:38 [note] /usr/sbin/mysqld: shutdown finish ...
i checked , didn't find programme using 3306, please see following.
root@site-digger:/var/log/mysql# sudo netstat active net connections (w/o servers) proto recv-q send-q local address foreign address state tcp 0 0 site-digger.com:59367 li566-52.members.li:ssh established tcp 0 0 site-digger.com:ssh 61.150.56.248:65255 established tcp 0 216 site-digger.com:ssh 61.150.56.248:61553 established tcp 0 0 site-digger.com:www 1.82.9.18:55526 time_wait active unix domain sockets (w/o servers) proto refcnt flags type state i-node path unix 2 [ ] dgram 600880492 unix 3 [ ] stream connected 600845962 unix 3 [ ] stream connected 600845961 unix 3 [ ] stream connected 600596531 unix 3 [ ] stream connected 600596530
i tried sudo mysql start. still not working. os: ubuntu 11.10
the results netstat -a -t following:
root@site-digger:/var/log/mysql# netstat -a -t active net connections (servers , established) proto recv-q send-q local address foreign address state tcp 0 0 *:www *:* hear tcp 0 0 *:ssh *:* hear tcp 0 0 *:https *:* hear tcp 0 20824 site-digger.com:59367 li566-52.members.li:ssh established tcp 0 0 site-digger.com:ssh 61.150.56.248:65255 established tcp 0 52 site-digger.com:ssh 61.150.56.248:61553 established tcp 0 0 site-digger.com:www crawl-66-249-73-2:45760 time_wait tcp 0 0 site-digger.com:www 218.30.103.146:49094 time_wait tcp6 0 0 [::]:ssh [::]:* hear
port 33 06. not 60. netstat shows active connections, not idle ones simply listening. need netstat -a -t
(to show tcp ports).
mysql ubuntu
javascript - Chrome extension how to inject my content script into all Facebook pages -
javascript - Chrome extension how to inject my content script into all Facebook pages -
my manifest looks this:
{ "manifest_version": 2, "name": "facebook extension", "version": "1.0", "browser_action": { "default_icon": "images/fbh.png", "default_popup": "fbh-popup.html" }, "permissions": [ "storage", "background", "tabs", "http://www.facebook.com/*", "https://www.facebook.com/*" ], "content_scripts": [ { "matches": [ "http://www.facebook.com/*", "https://www.facebook.com/*" ], "js": ["js/jquery-1.9.1.min.js", "js/fbh-main.js"], "css": ["css/fbh-main.css"], "run_at": "document_end" } ], "background":{ "persistent": true, "scripts": ["js/jquery-1.9.1.min.js","js/fbh-background.js"] } }
i want inject content script each time go new page within facebook. example, if click on user's profile want inject content script.
in background page have next listener:
chrome.tabs.onupdated.addlistener(function(tabid, changeinfo) { console.log(changeinfo); if (changeinfo.status === 'complete') { chrome.tabs.executescript(null, {file: "js/fbh-main.js"}); } });
there couple of problems this, however. first, function tries inject content script pages. need able read manifest permissions. second, if start @ www.facebook.com, content script it's supposed do. if, there, click profile "foo" , go www.facebook.com/foo, content script injected (as evidenced console.log message) not it's supposed do. think it's beingness injected because if navigate straight www.facebook.com/foo, content script loaded , thing.
is there improve way this?
try code
chrome.tabs.onupdated.addlistener(function(tabid, changeinfo,tab) { console.log(changeinfo); if ((tab.url.indexof("http://www.facebook.com/") !=-1 || tab.url.indexof("https://www.facebook.com/") !=-1) && changeinfo.status === 'complete') { chrome.tabs.executescript(tabid, {file: "js/fbh-main.js"}); } });
chrome.tabs.executescript(null,
execute script in active tab of current window, may alter on user interaction, chrome.tabs.executescript(tabid
ensure script injection in tab targeted. chrome.tabs.onupdated.addlistener
fire every tab, added filter tab.url.indexof("https://www.facebook.com/")
ensure script injected in face book pages. share manifest ,content script , related files if problem still persist
javascript google-chrome-extension
asp.net - how to secure SOAP message in WCF? -
asp.net - how to secure SOAP message in WCF? -
i used wcf servicee library implement simple web services , works, found wcf uses ws-security standard secure soap messages.
in project have built simple web service enhance web service using different methods secure it, without using <wsss>
i don't know if selection implement web service utilize wcf or have utilize approach that. have work on soap message secure soap message.
using system; using system.collections.generic; using system.linq; using system.runtime.serialization; using system.servicemodel; using system.text; using system.data; using system.data.sqlclient; namespace wcfbookaddress { [servicecontract] public interface iservice1 { [operationcontract] string getdata(int value); [operationcontract] boolean addaddress(string vname, string vfathername, string vstreet, string vcity, int64 vphoneno); [operationcontract] dataset getalladdress(); [operationcontract] dataset getaddressbyname(string vname); [operationcontract] compositetype getdatausingdatacontract(compositetype composite); // todo: add together service operations here } // utilize info contract illustrated in sample below add together composite types service operations [datacontract] public class compositetype { bool boolvalue = true; string stringvalue = "hello "; [datamember] public bool boolvalue { { homecoming boolvalue; } set { boolvalue = value; } } [datamember] public string stringvalue { { homecoming stringvalue; } set { stringvalue = value; } } }
}
asp.net wcf web-services ws-security
sql - Mysql Subquery Syntax -
sql - Mysql Subquery Syntax -
i'm wondering why statements select * t
appear in mysql subqueries following.
the next deletes oldest 3 rows in table according created_time
column.
why right
delete mytable id = ( select * ( select id mytable order created_time asc limit 3')as t)
and not
delete mytable id = (select id mytable order created_time asc limit 3)
?
to me, sec form makes sense. doesn't work , i'd understand why first necessary. specifically, t
, as t
do?
in many databases, subquery in from
clause needs have explicit alias. as
optional. typically utilize as
columns , leave out tables:
delete mytable id = ( select * ( select id mytable order created_time asc limit 3') t)
why need subquery vagary of mysql. doesn't allow table reference in delete
or update
appear in subquery clause. oh, allow in subquery-within-a-subquery clause. so, pretty easy work around limitation.
mysql sql syntax subquery
wordpress - Remove fb_source from incoming URLs -
wordpress - Remove fb_source from incoming URLs -
this first question here since find need know pretty quickly. i'm not familiar editing .htaccess, i'm rightly nervous doing so.
here's want find out. can remove after , including '?' incoming url?
effectivly turning: http://example.com/userful-info?fb_junk%20%13%69 into http://example.com/userful-info
in post had answered question removing appended info fb_action_ids following:
rewriteengine on rewritecond %{query_string} (^|&)fb_action_ids= rewriterule ^/?detail/link- %{request_uri}? [l,r=301]
this looks in realm, i'd remove appended info incoming urls. annoying since if shared appended info comes other sites aren't fb. disqus, twitter, tumblr.
i don't want twitter users sharing url site fb's info. doesn't create sense.
thank you, alex theberge
though break ability utilize query parameters throughout site (and since/if using wordpress, may nowadays issues wordpress functionality, "buyer beware"), next site presents solution may solve issue - http://briancray.com/posts/htaccess-hack-remove-url-query-strings/
what suggests in .htaccess
file before "# begin wordpress" section, include following:
rewriteengine on rewritecond %{query_string} !="" #if there query string rewritecond %{query_string} !^p=.* #wordpress users: allow post tempalinks rewritecond %{request_uri} !^/wp-admin.* #wordpress users: don't break admin rewriterule ^(.*)$ /$1? [r=301,l] #remove query string
wordpress .htaccess
grep - Find include guard typos in C++ with gnu coreutils -
grep - Find include guard typos in C++ with gnu coreutils -
below typo c++ include guard. both should read _myfile_h_
.
#ifndef _myfile_h_ #define _myflie_h_
how suggest searching bunch of header files typo using gnu coreutils (e.g. grep, awk)?
you utilize awk
:
{ if ($1 == "#ifndef") { was_ifdef = 1; def = $2 } else if ($1 == "#define" && was_ifdef) { if ($2 != def) printf("mismatch in %s: expected %s found %s\n", filename, def, $2); } else was_ifdef = 0; }
there may more clever ways this, (to me) quite clear , easy.
note: show "false positives" if file contains
#ifndef foo_defined typedef int foo; #define foo_defined #endif
c++ grep include-guards gnu-coreutils
xcode - How to submit an OSX app with a COMMAND LINE helper in its bundle -
xcode - How to submit an OSX app with a COMMAND LINE helper in its bundle -
so, i'm in same situation that discussed here but can't apply proposed solution because helper app i'm building add together main app bundle it's command line executable , own xcode project doesn't have bundle name, embedded.provisionfile nor entitlements.
my app has been rejected 2 times "not having executable sandboxed". well, main app sandboxed , command line executable appears codesigned.
if run:
$ codesign --display --verbose=4 ./myfile
i get:
executable=/path/to/my/executable/myfile identifier=myfile format=mach-o lean (i386) codedirectory v=20100 size=43918 flags=0x0(none) hashes=2188+5 location=embedded hash type=sha1 size=20 cdhash=f28731c0d2482e0b0252efe0f1d33525a292f7c0 signature size=4358 authority=3rd party mac developer application: name authority=apple worldwide developer relations certification authorization authority=apple root ca signed time=08/02/2013 03:15:58 info.plist=not bound sealed resources=none internal requirements count=1 size=188
so think command signed. what's proper method sandbox , codesign kind of file?.
xcode osx sandbox code-signing
MalformedURLException with Jackrabbit OSGi Bundle on Glassfish 3.1.2 -
MalformedURLException with Jackrabbit OSGi Bundle on Glassfish 3.1.2 -
i'm trying utilize latest jackrabbit stable release (2.4.3) , deploy osgi bundle on glassfish v3.1.2.
first, tried jackrabbit-standalone bundle, had problem weird dependencies (com.ibm.jvm!?). noticed jackrabbit-bundle project , deployed required dependencies (commons logging, slf4j, jcr api, db2 driver).
although bundle seems start fine after installing it, when restart glassfish server, next exception thrown:
[#|2013-02-08t09:49:12.559+0100|severe|glassfish3.1.2|javax.enterprise.resource.webcontainer.jsf.config|_threadid=18;_threadname=thread-2;|critical error during deployment: com.sun.faces.config.configurationexception: java.util.concurrent.executionexception: java.net.malformedurlexception: unknown protocol: jndi @ com.sun.faces.config.configmanager.getconfigdocuments(configmanager.java:672) @ com.sun.faces.config.configmanager.initialize(configmanager.java:322) @ com.sun.faces.config.configurelistener.contextinitialized(configurelistener.java:225) @ org.apache.catalina.core.standardcontext.contextlistenerstart(standardcontext.java:4750) @ com.sun.enterprise.web.webmodule.contextlistenerstart(webmodule.java:550) @ org.apache.catalina.core.standardcontext.start(standardcontext.java:5366) @ com.sun.enterprise.web.webmodule.start(webmodule.java:498) @ org.apache.catalina.core.containerbase.addchildinternal(containerbase.java:917) @ org.apache.catalina.core.containerbase.addchild(containerbase.java:901) @ org.apache.catalina.core.standardhost.addchild(standardhost.java:733) @ com.sun.enterprise.web.webcontainer.loadwebmodule(webcontainer.java:2018) @ com.sun.enterprise.web.webcontainer.loadwebmodule(webcontainer.java:1669) @ com.sun.enterprise.web.webapplication.start(webapplication.java:109) @ org.glassfish.internal.data.engineref.start(engineref.java:130) @ org.glassfish.internal.data.moduleinfo.start(moduleinfo.java:269) @ org.glassfish.internal.data.applicationinfo.start(applicationinfo.java:301) @ com.sun.enterprise.v3.server.applicationlifecycle.deploy(applicationlifecycle.java:461) @ com.sun.enterprise.v3.server.applicationloaderservice.processapplication(applicationloaderservice.java:375) @ com.sun.enterprise.v3.admin.adapter.installerthread.load(installerthread.java:210) @ com.sun.enterprise.v3.admin.adapter.installerthread.run(installerthread.java:108) caused by: java.util.concurrent.executionexception: java.net.malformedurlexception: unknown protocol: jndi @ java.util.concurrent.futuretask$sync.innerget(futuretask.java:222) @ java.util.concurrent.futuretask.get(futuretask.java:83) @ com.sun.faces.config.configmanager.getconfigdocuments(configmanager.java:670) ... 19 more caused by: java.net.malformedurlexception: unknown protocol: jndi @ java.net.url.<init>(url.java:601) @ java.net.url.<init>(url.java:464) @ java.net.url.<init>(url.java:413) @ java.net.uri.tourl(uri.java:1080) @ com.sun.faces.config.configmanager$parsetask.call(configmanager.java:920) @ com.sun.faces.config.configmanager$parsetask.call(configmanager.java:865) @ java.util.concurrent.futuretask$sync.innerrun(futuretask.java:303) @ java.util.concurrent.futuretask.run(futuretask.java:138) @ com.sun.faces.config.configmanager.getconfigdocuments(configmanager.java:656) ... 19 more |#]
searching error didn't me far. tried increment bundle startlevel 10, assuming started early, didn't help.
does have thought may problem? using jackrabbit pure osgi bundle yet (excluding apache sling stuff)?
the problem not specific jackrabbit. see http://java.net/jira/browse/glassfish-18880 error discussed @ length. has been fixed in glassfish trunk builds. if using glassfish 3.1.2.x, utilize work around mentioned in status whiteboard of bug. essentially, have disable admin console come automatically part of server startup running next command:
asadmin set configs.config.server-config.admin-service.property.adminconsolestartup=never
hope helps,
sahoo
glassfish osgi jackrabbit jcr malformedurlexception
c# - Function takes pointer to structure -
c# - Function takes pointer to structure -
i have construction in c
struct system_info { const char *name; const char *version; const char *extensions; bool path; };
and function signature
void info(struct system_info *info);
i'm trying utilize function this:
[dllimport("...")] unsafe public static extern void info(info *test); [structlayout(layoutkind.sequential, charset = charset.ansi)] public unsafe struct info { public char *name; public char *version; public char *extensions; public bool path; }
and on main:
info x = new info(); info(&x);
i'm getting error, pointers cannot reference marshaled structures, how can manage this?
there's no need @ utilize unsafe
here. this:
public struct info { public intptr name; public intptr version; public intptr extensions; public bool path; }
and function is:
[dllimport("...")] public static extern void getinfo(out info value);
you may need specify cdecl
calling convention, depending on native code.
call function this:
info value; getinfo(out value); string name = marshal.ptrtostringansi(value.name); // other 2 strings fields
since there no mention of string length in native code posted, i'm assuming strings allocated native code , don't need to deallocate them.
c# pinvoke